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


Click here to return to the 'Alternate approaches' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Alternate approaches
Authored by: sabi on Mar 13, '02 03:50:20AM
sudo mkdir /afptemp

# Can be anything instead of afptemp, but needs to be in root directory


Why be root? You can create a mount point anywhere you want.

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

I'd be interested to know what was problematic about them, since I've used both successfully. Here's an example of copying BBEdit to my iDisk and back:

% mkdir iDisk

% mount_afp afp://njriley:password@idisk.mac.com/njriley iDisk
% launch -f ~apps/Applications/BBEdit 6.5.2/BBEdit
/Volumes/GrayApps/Applications/BBEdit 6.5.2/BBEdit: scriptable Mac OS X application [Carbon, prefers native OS X]
type: 'APPL' creator: 'R*ch'
[can't access CFBundle for application]
kind: Application
data fork size: 4.47 MB on disk (4683709 bytes used)
rsrc fork size: 1.90 MB on disk (1989554 bytes used)
created: 10/11/01 8:04:53 AM
modified: 1/24/02 12:00:24 PM
accessed: 3/13/02 1:20:18 AM [only updated by Mac OS X]
% ditto -rsrc ~apps/Applications/BBEdit 6.5.2/BBEdit iDisk/Documents/
% launch -f iDisk/Documents/BBEdit
iDisk/Documents/BBEdit: scriptable Mac OS X application [Carbon, prefers native OS X]
type: 'APPL' creator: 'R*ch'
[can't access CFBundle for application]
kind: Application
data fork size: 4.47 MB on disk (4683709 bytes used)
rsrc fork size: 1.90 MB on disk (1989554 bytes used)
created: 10/11/01 5:04:53 AM
modified: 1/24/02 12:00:24 PM
accessed: 1/24/02 12:00:24 PM [only updated by Mac OS X]
% ditto -rsrc iDisk/Documents/BBEdit /tmp
% launch -f /tmp/BBEdit
/tmp/BBEdit: scriptable Mac OS X application [Carbon, prefers native OS X]
type: 'APPL' creator: 'R*ch'
[can't access CFBundle for application]
kind: Application
data fork size: 4.47 MB on disk (4683709 bytes used)
rsrc fork size: 1.90 MB on disk (1989554 bytes used)
created: 10/11/01 5:04:53 AM
modified: 1/24/02 12:00:24 PM
accessed: 1/24/02 12:00:24 PM [only updated by Mac OS X]
% umount iDIsk


As you can see, the resource fork was preserved, so were the type and creator, even the creation/modification dates.

[ Reply to This | # ]
Alternate approaches
Authored by: brettc on Mar 13, '02 09:58:01AM
These are excellent tips, however I'm trying to take this approach yet allow backups to only copy changed files, so if I run this command as above, only changed items from a 20GB set of files are copied every evening at 2AM or something. It doesn't seem very efficient to copy everything every time. "rsync" does this with the command listed below, however the resource forks aren't retained. Anyone have an idea of how to get the functionality of both of these in one command. I would think Apple would have updated ditto with this sync or backup functionality by now, but it's still dated 1994 when you do a "man" on it! This works, but copies the whole set every time: sudo ditto -v -rsrcFork '/Volumes/MacintoshHD/Desktop Folder/Projects/' '/backup/Projects/' This is nice, but doesn't get the resource forks: rsync -av --delete '/Volumes/Macintosh HD/Desktop Folder/Projects/' '/backup/Projects/'

Thanks for any feedback! I could probably install someone else's copy tool in unix perhaps, I was just hoping something might already be built in.

[ Reply to This | # ]
Alternate approaches
Authored by: sabi on Mar 13, '02 05:06:33PM
Ditto doesn't do syncing. There are some Perl modules that do, though, and a command-line rsync-a-like (psync).
psync   [-d][-n][-q|-v] source_items ... target_directory
psync -r[-d][-n][-q|-v] source_directory target_directory
If you have Fink, just install 'macosx-file-pm' and you'll get psync. Fink's info says:
macosx-file-pm-0.61-1: A collection of modules to manipulate files on MacOS X.


[ Reply to This | # ]
RsyncX -- rsync with HFS+ support
Authored by: sjk on Mar 16, '02 03:04:36PM
Alternate approaches
Authored by: danwan on Mar 13, '02 10:50:38PM
iDisk/ditto problem details

Ditto to my AFP share works fine.

But ditto to iDisk had a file name too long problem:

danwan% ditto -V -rsrcFork /Applications/BBEdit Lite 6.1 /Users/danwan/idisktemp/Documents/BB

>>> Copying /Applications/BBEdit Lite 6.1
copying file ./BBEdit Lite 6.1 ... /Users/danwan/idisktemp/Documents/BB/BBEdit Lite 6.1.__XXCOPIERXX__.810.0: File name too long
/Users/danwan/idisktemp/Documents/BB/BBEdit Lite 6.1: File name too long


So ditto-ing the whole folder to iDisk didn't work. But ditto-ing the OS9 and the OSX apps individually to iDisk did work:

danwan% cd /Applications/BBEdit Lite 6.1


danwan% ditto -V -rsrcFork BBEdit Lite 6.1 for OS 9 /Users/danwan/idisktemp/Documents/BBos9app
>>> Copying BBEdit Lite 6.1 for OS 9
copying file ./BBEdit Lite 6.1 for OS 9 ... 2409200 bytes

danwan% ditto -V -rsrcFork BBEdit Lite 6.1 /Users/danwan/idisktemp/Documents/BBosXapp
>>> Copying BBEdit Lite 6.1
copying file ./BBEdit Lite 6.1 ... 2268268 bytes


[ Reply to This | # ]
Alternate approaches:Or the unix way
Authored by: aaron on Mar 13, '02 11:27:54PM

There's always the secure, gzipped transfer:
ssh remotehost 'tar czf - FileName' | tar xzf -

I usually alias this to netcp or something



[ Reply to This | # ]
Alternate approaches:Or the unix way
Authored by: sjk on Mar 16, '02 03:09:36PM
launch?
Authored by: aiBoek on Mar 14, '02 06:12:12PM

What's this launch command? I don't seem to have it on my computer, though I do have DevTools installed.

Thanks for the great tip, though!



[ Reply to This | # ]