Resource Fork

pedz

Registered
I generally prefer to do things from the command line but I always worry about it. If I understand things correctly, on Mac's file system there is a data fork and a resource fork. Most of the time, now days, there is no resource fork. And, of course, the typical Unix commands like tar and cp do not know about the resource fork.

But I'd like a command that would simply tell me if a file has a resource fork or not. Does such a command exist already? If not, can someone point me to the docs necessary to write such a command?

Thanks
 
pedz said:
I generally prefer to do things from the command line but I always worry about it. If I understand things correctly, on Mac's file system there is a data fork and a resource fork. Most of the time, now days, there is no resource fork. And, of course, the typical Unix commands like tar and cp do not know about the resource fork.

But I'd like a command that would simply tell me if a file has a resource fork or not. Does such a command exist already? If not, can someone point me to the docs necessary to write such a command?

Thanks

Hi -

From hunting around on the 'net a bit I found that you can "ls -l filename/rsrc" and if it's size is not zero, you have a resource fork. I wrote a short shell script called lsrsrc to take advantage of this which you can grab from:

http://www.bgstech.com/download.php

After you download it, make sure it's executable (chmod +x lsrsrc) and then try it out (lsrsrc filename). Any file which has a resource fork will be displayed with a "RF" tag, otherwise it'll just show as "--". Hope this helps.

By the way I found a good site for comand-line based backups which addresses resource forks:
http://www.kernelthread.com/mac/apme/archive

And finally, credit for the "ls -l filename/rsrc" idea goes to:
http://sean.typepad.com/ditto/2004/07/mac_os_x_resour.html
 
Back
Top