Writing to the resource fork

Thierry th.douez at gmail.com
Fri May 28 05:12:34 EDT 2010


Hi  Mark,

I just tried this in a Terminal :

TdzMacBook:~ tdz$ echo "WEWEWEE" > x.txt

TdzMacBook:~ tdz$ ls -l x.txt/rsrc
-rw-r--r--  1 tdz  staff  0 28 mai 11:08 x.txt/rsrc

TdzMacBook:~ tdz$ echo "ASDASDASDDADSASDASDASD" > x.txt/rsrc

TdzMacBook:~ tdz$ ls -l x*
-rw-r--r--@ 1 tdz  staff  8 28 mai 11:09 x.txt

TdzMacBook:~ tdz$ ls -l x.txt/rsrc
-rw-r--r--  1 tdz  staff  23 28 mai 11:09 x.txt/rsrc

TdzMacBook:~ tdz$ cat x.txt/rsrc
ASDASDASDDADSASDASDASD

TdzMacBook:~ tdz$ cat x.txt
WEWEWEE



If this is OK for you, you can use the shell() to do your job.

HTH.

Thierry


> Thanks, Scott, but a short delay in the script doesn't make a difference. I have noticed that I can write the entire resource fork at once using /path/to/file.ext/rsrc (note the additional /rsrc) but this doesn't let me set individual resources.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> 
>> 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




More information about the Use-livecode mailing list