Mar 01, '07 07:30:04AM • Contributed by: roncross@cox.net
I was recently trying to do a secure copy of a text clipping from one Mac to another Mac. When I first performed this with this command...
scp joe_blow@192.168.1.100:Desktop/foo.textClipping ~/Desktop/
...only the filename transfered over to the Mac, but the content was empty. That's because the text clipping keeps the actual text in the resource fork of the file.
So to solve this problem, I simply use the -E option in scp, and both the filename and resource forks are preserved. According to man scp, this only works if both Macs have 10.4 or later installed on their machines. You must also make sure you have ssh enabled. So this would look like the following:
scp -E joe_blow@192.168.1.100:Desktop/foo.textClipping ~/Desktop/
The :Desktop after the IP address means that Desktop is relative to the home user's account. For an absolute path use :/, followed by the path name. If you want to preserve the modification and access times as well as the content, then in addition use the -p option:
scp -Ep user@hostname:path path
Of course, these options can also be applied if you are sending a file using scp to a remote machine.
