Setting Mac OS File Type & Creator

Martin Baxter martin at materiaprima.fsnet.co.uk
Mon Aug 15 16:54:58 EDT 2005


Dan,

Under OS9 and earlier the type and creator are stored by the finder in a 
hidden file on the disk where the file resides. So forget the resource 
fork. Res Edit just sets the finder information in this case.
You can set the global filetype property in rev before writing the file. 
Once the finder has this info about the file, it will then be copied to 
any mac media that the file itself is copied to. To transmit the file 
via a network with this data intact I suggest zip or stuffit, both of 
which should keep type creator info intact.

Martin Baxter

Dan Shafer wrote:
> This ought to be duck soup. But it's turned into alligator stew with  a 
> live alligator.
> 
> I have a custom property set to a file. I want to write this file out  
> to an OS 9 system so that it shows up in Finder as a PDF file. From  all 
> I can gather, I have a two-line problem:
> 
>   set the fileType to "CAROPDF "
>   put PDFToOpen into URL "binfile:myFile.pdf"
> 
> But alas, this does not work. The file type and creator come up  empty. 
> If I use ResEdit to set the file type and creator as in the  command 
> above, the file becomes a PDF file that Acrobat Reader  recognizes. So I 
> know I have the creator and file type correct. Am I  perhaps doing this 
> in the wrong place?
> 
> A clue: ResEdit tells me the file I'm writing has no resource fork. I  
> was under the impression that using "binfile" solved that problem?
> 
> I gather then that this has something to do with resfile: types but I  
> can't find anything in the docs about creating a resource fork, only  
> about copying them. But when I do a getResources on an OS9 file, as  far 
> as I can tell, the type and creator aren't stored in the resource  fork 
> (at least not as identifiable resources), so I'm basically lost  and 
> under very tight deadline.
> 
> 
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dan Shafer, Revolution Consultant and Author
> http://www.shafermedia.com
> Get my book, "Revolution: Software at the Speed of Thought"
>  From http://www.revolutionpros.com, Click "My Stuff"
> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 




More information about the use-livecode mailing list