Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'cp and rsrc forks' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
cp and rsrc forks
Authored by: JohnnyMnemonic on Apr 14, '04 12:17:28PM

Be careful with "cp"--it will not move Resource forks, which, depending on the Application and depending on the file--are still used.

CpMac will preserve Resource forks, but is only present after a Developer Tool install.

I'd be interested to hear from folks which apps still want to have their resource fork preserved, as I haven't investigated it much. Is is just Classic Apps?



[ Reply to This | # ]
cp and rsrc forks
Authored by: inik on Apr 14, '04 01:28:01PM

"cp --rsrc [source] [destination]" will handle resource forks. It's undocumented, but it works.



[ Reply to This | # ]
ditto
Authored by: Graff on Apr 14, '04 01:57:31PM

Use ditto instead. It's part of the default install and it handles resource forks and metadata. You use the --rsrc flag to tell it to handle the resource forks and metadata. In this hint you would replace the line:

cp -R ~/FolderX ~/EnclosingFolder

with

ditto --rsrc ~/FolderX ~/EnclosingFolder



[ Reply to This | # ]
cp and rsrc forks
Authored by: Crimson Napkin on Apr 14, '04 02:11:50PM

I had never heard that you could use -rsrc with cp (with ditto, yes, but cp...hmmm).

Use cp for files that don't have resource forks or metadata. Use CpMac (comes with the Developer Tools) for things that have these. For me, this means copy photos with CpMac in order to preserve the image metadata.

You can also use these to copy huge files to other machines on your network. It is faster to copy with cp or CpMac than it is to drag and drop. For example, you have a giant CAD project that needs to go to your bosses machine. Use CpMac to copy it to a network accesible directory on his machine and the file will copy faster than drag and drop.

---
macosxhints.com is one reason PC users should switch to a Mac.

[ Reply to This | # ]

cp -R and rsrc forks
Authored by: googoo on Apr 14, '04 02:49:24PM

cp does not copy resource forks, but cp -R seems to do so! Maybe it works because the resource fork looks like a file in a subdirectory. For example if the filename is file1, its resource fork is file1/rsrc. Try using

% ls file1/rsrc

on a file that you know has a resource fork. Now try

% cp -R file1 another/location

Go to another/location and list its resource fork. It is there!

-Mark

[ Reply to This | # ]