Copy remote files with resource forks

Mar 12, '02 09:44:35PM

Contributed by: danwan

I wanted to copy an OS 9 application folder from a remote machine to my local one, given that I only had Remote Login access to the far computer.

Since the application and its files had resource forks, this limited my choices. Here's what worked:

  1. Turn on File Sharing on the local computer
  2. ssh to remote
  3. remotely mount the afp volume you just shared
  4. copy files to the afp volume using ditto
  5. unmount the afp volume
  6. exit ssh, and
  7. turn off local File Sharing.
Read on to see how to do steps 2-6...

ssh -2 -l remoteUserName remote.wherever.com
sudo mkdir /afptemp
# Can be anything instead of afptemp, but needs to be in root directory

sudo mount_afp afp://user:password@111.111.111.111/user /afptemp
# Substitute your local IP address for 111.111.111.111

sudo ditto -V -rsrcFork remoteFolder /afptemp/localFolder
# -V is nice to see progress as each file is copied

sudo umount /afptemp
exit
Thanks to Mount AFP volumes from the terminal by dreness, and for ditto info, Easy and complete folder backups by robg.

Other approaches I tried that didn't work: Some popular methods like secure copy (scp, which the fine program RBrowser uses) don't copy resource forks. And I tried both iDisk (which is resource-fork friendly) and Disk Image (which can contain files with resource forks inside, yet doesn't need a resource fork itself) approaches, but both were problematic.Additional reading:

Comments (12)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020312214435203