Way to retrieve creator-type of OS X files?

JonathanC at ag.nsw.gov.au JonathanC at ag.nsw.gov.au
Thu Sep 23 06:34:58 EDT 2004

D'oh! Once again, I have written a reply while disconnected from the 
Internet (on a train) and have forgotten to send it once I am connected 
again. Now, one week late, here is my reply to Richard Gaskin's email:


Just a slight modification to Richard Gaskin's fwMacFileType() function, 
to handle the case where a file has no file creator/type (e.g. many HTML 

  put last item of line tLine of tFileList into tType
(in the 5th-last line)
  put item 11 of line tLine of tFileList into tType


Jonathan Cooper
Manager of Information / Website
Art Gallery of New South Wales
Sydney, Australia

Richard Gaskin wrote on 16/09/2004 09:04:34 PM:

> Robert Brenstein wrote:
> > Theoretically, you should be able to use Rinaldi's externals GetFInfo 
> > and SetFInfo. I say theoretically because GetFInfo causes a hard crash 

> > and both Frederic and RunRev folks blame the other (see bug 855). 
> > Furthermore, there are no OSX versions of those externals.
> > 
> > IMHO it would be reasonable to support platform-specific features like 

> > these through an external.
> Simple enough to script -- I wrote this one to get just the file type, 
> but could easily be extended to include creator code:
> function fwMacFileType pPath
>    local tSaveDir, tShortFileName, tFileList, tLine, tType
>    --
>    put the directory into tSaveDir
>    set the itemdel to "/"
>    put the last item of pPath into tShortFileName
>    delete last item of pPath
>    set the directory to pPath
>    put the detailed files into tFileList
>    put lineoffset(cr&urlEncode(tShortFileName)&comma, 
>   into tLine
>    if tLine > 0 then
>      set the itemdel to comma
>      put last item of line tLine of tFileList into tType
>    end if
>    set the directory to tSaveDir
>    return tType
> end fwMacFileType
> -- 
>   Richard Gaskin
>   Fourth World Media Corporation
>   ___________________________________________________________
>   Ambassador at FourthWorld.com       http://www.FourthWorld.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution

This e-mail message is intended only for the addressee(s) and contains 
information which may be confidential.  If you are not the intended 
recipient please advise the sender by return email, do not use or disclose 
the contents, and delete the message and any attachments from your system. 
 Unless specifically indicated, this email does not constitute formal 
advice or commitment by the sender or the Art Gallery of NSW  (ABN 24 934 
492 575) or its related entities.

More information about the use-livecode mailing list