Writing to the resource fork
scott at elementarysoftware.com
Fri May 28 02:58:15 EDT 2010
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?
(Now with 20% less chalk dust!)
email scott at elementarysoftware.com
On May 27, 2010, at 3:25 PM, Mark Schonewille wrote:
> 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:
More information about the Use-livecode