Setting Mac OS File Type & Creator

Dan Shafer revdan at danshafer.com
Mon Aug 15 14:31:17 EDT 2005


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"






More information about the use-livecode mailing list