RE: Reading resource forks
RE: Reading resource forks
- Subject: RE: Reading resource forks
- From: "Will Parker" <email@hidden>
- Date: Sun, 7 Dec 2003 19:14:20 -0800
- Thread-topic: Reading resource forks
Wow! That's everything I need to get down to work. Thanks for the help!
-Will
--------------------
Will Parker
email@hidden
Macintosh Business Unit
-----Original Message-----
From: Graff [
mailto:email@hidden]
Sent: Friday, December 05, 2003 6:00 PM
To: Will Parker
Cc: AppleScript-Users listat apple.com
Subject: Re: Reading resource forks
I was fooling around a bit more and I found out that trying the same process on the data fork resulted in the exact same file as with the resource fork. I tried doing it with a shell script and it worked fine, so here's an example with a shell script:
Keep in mind that the option-return character used for line continuation in Script Editor gets converted to a comma or something else by this mailing list. There should be one of them at the end of each of the lines 6, 10, 17, and 21.
---------
set posixPathToFile to "/Users/username/Desktop/Test"
set saveLocation to ((path to desktop) as text) try
set writeIsOpen to false
set theResource to do shell script "cat " & ,
posixPathToFile & "/..namedfork/rsrc"
display dialog "rsrc read"
set theWriteFile to open for access saveLocation & ,
"SystemRSRC.txt" with write permission
set writeIsOpen to true
write theResource to theWriteFile
close access theWriteFile
set writeIsOpen to false
set theData to do shell script "cat " & ,
posixPathToFile & "/..namedfork/data"
display dialog "data read"
set theWriteFile to open for access saveLocation & ,
"SystemData.txt" with write permission
set writeIsOpen to true
write theData to theWriteFile
close access theWriteFile
set writeIsOpen to false
on error
display dialog "Didn't work"
if writeIsOpen then close access theWriteFile end try
---------
- Ken
On Dec 5, 2003, at 7:55 PM, Will Parker wrote:
>
Thanks! I'll give that a try.
>
>
-Will
>
--------------------
>
Will Parker
>
email@hidden
>
>
Macintosh Business Unit
>
>
>
-----Original Message-----
>
From: Graff [mailto:email@hidden]
>
Sent: Friday, December 05, 2003 3:52 PM
>
To: Will Parker
>
Cc: AppleScript-Users listat apple.com
>
Subject: Reading resource forks
>
>
Well technically under HFS+ you can access a resource fork for a file
>
with the name "filename" by using:
>
filename/..namedfork/rsrc
>
the data fork would be at:
>
filename/..namedfork/data
>
>
I believe can also use the classic "Finder" path format:
>
filename:..namedfork:rsrc
>
>
So I suppose that you could try opening the resource fork as a normal
>
file with read-only access. It *should* work just fine.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.