Writing to the resource fork
Joe F.
joef1 at mac.com
Fri May 28 18:24:39 EDT 2010
Your example worked for me on OS X 10.6.3 when I made these changes.
put empty into URL "binfile:~/desktop/resource test.dat"
get setResource("~/desktop/resource test.dat","TEXT",999,"Test","U","Hello World")
On May 27, 2010, at 6: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