Writing to the resource fork

Scott Morrow scott at elementarysoftware.com
Fri May 28 01:58:15 CDT 2010


Hello Mark,

I use setResource in an application (in several places) and it seems to work.  I can't see an error in the script you posted.  (I haven't ever used the "flaglist" feature, though.)

Might giving the OS a short "breather" between creating the file and setting the resource, help?


Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web       http://elementarysoftware.com/
email     scott at elementarysoftware.com
office     1-800-360-734-4701
------------------------------------------------------





On May 27, 2010, at 3:25 PM, Mark Schonewille wrote:

> Hi,
> 
> For a new project, it is essential that I can read from and write to the resource fork of a file. I am not looking for a way to copy resource forks.
> 
> I am trying to use the setResource function, but it doesn't work. I tried it with Rev 4.0 on Mac OS X 10.5 and Rev 2.6.1 on Mac OS 9.2.2. With both systems, I get the same result: the resource is created (including ID, name and flags, but the data are not written to it.
> 
> On Mac OS X, contrary to what the documentation claims, the file isn't created automatically, if the file doesn't exist yet. Therefore, I create the file before writing the resource fork.
> 
> Does anyone have a clue about what might be wrong with the following two lines?
> 
> put empty into url "binfile:~/desktop/resource test.dat"
> get setresource("/Users/Mark/desktop/resource test.dat","MARK",999,"Test","U","Hello World")
> 
> Althought the serResource function doesn't work correctly for me, the getResource and getResources functions work fine on both systems.
> 
> I tried to find a solution in the archives, but it looks like this function is rarely used. I need it though.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> 
> Economy-x-Talk is always looking for new projects. Contact me for a quote http://economy-x-talk.com/contact.html
> Download Clipboard Link http://clipboardlink.economy-x-talk.com and share the clipboard of your computer over the local network.
> 
> _______________________________________________
> 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