Hi all,
I'm working on something where I will want to accept only certain types of file. Namely xml's from a particular creator. But I can't seen to find out what the code is for these files. So if I want to use the "answer file with" command to filter only this file type I have no chance.
So, is there a way I can do a kind of "get fileType of [file]" command to find out what the file type code is?
I don't want to have to load the file (which is potentially very large) only to then use an if statement to determine that it is not the right kind.
Since Snow Leopard Apple have abandoned use of the Creator/Type codes I wonder why RunRev haven't updated Livecode to now accept the standard "with filter" so we can use extension filters instead for OSX? Probably cause its harder to determine if the user is on SL or Lion instead of Leopard or before. But as my app will only be downloadable from the AppStore that won't be an issue!
Thanks in advance
Sean
get fileType of file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: get fileType of file
Managed to find an app called HexEdit that was able to display files Creator and Type info. First I proved it worked by trying out some jpegs etc. However, when I tried the XML's I am looking to decode, they do not have any Creator or Type details. And this XML comes from one of Apples own Apps. So it's clear they have indeed abandoned this old format of file id in favour of the windows style extension identification.
So I've opted to do the 'if filename contains ".ext" then' method (or something like that, you know what I mean!) until Livecode gets an update.
Cheers for looking though people.
Pi
So I've opted to do the 'if filename contains ".ext" then' method (or something like that, you know what I mean!) until Livecode gets an update.
Cheers for looking though people.

Pi