Reading resource forks
Reading resource forks
- Subject: Reading resource forks
- From: Graff <email@hidden>
- Date: Fri, 05 Dec 2003 18:52:02 -0500
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.
I wrote a little script to test it and it seems to work - here it is:
------
try
set didOpenRead to false
set didOpenWrite to false
set theReadFile to open for access ((path to desktop) as text) &
"Test:..namedfork:rsrc"
set didOpenRead to true
set theResources to read theReadFile
close access theReadFile
set theWriteFile to open for access ((path to desktop) as text) &
"TestRSRC.txt" with write permission
set didOpenWrite to true
write theResources to theWriteFile
close access theWriteFile
on error
display dialog "Didn't work"
if didOpenRead then close access theReadFile
if didOpenWrite then close access theWriteFile
end try
------
On Dec 5, 2003, at 5:01 PM, Will Parker wrote:
Now then - can someone give me an idea of how to open file resources
read-only? I need to grab some esoteric font information from the
'FOND'
resource of font files, and I'd like to do it entirely in AppleScript
by
parsing out the file.
_______________________________________________
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.