Getting the type code of a file under OSX

Howard Bornstein howard.bornstein at gmail.com
Fri Jul 29 19:56:07 EDT 2005


I wanted to check to see if I'm missing something obvious. I want to
be able to get the type code of a specific file under OSX. As far as
I've been able to find, there is only one way to get the type code--
with the files function. The detailed files includes the type and
creator codes. However, this gets the entire list of files in the
default folder. Unless there's something I'm missing, the sequence
would be something like this:

1) Get the full path of the file you want the type code for
2) Extract the folder it's in
3) Set the default folder to that folder
4) Get the detailed files
5) Compare the file name with item one of every line in the files
6) When you find a match, extract the last item from the detailed file
description which is the type/creator code.

This seems like a lot of work, just to get an attribute of a file. We
have the filetype property, where we can set the type of a file. Isn't
there a simple way to *get* the type of a file?

-- 
Regards,

Howard Bornstein
-----------------------
www.designeq.com



More information about the use-livecode mailing list