image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
LinkBack Thread Tools
  #1  
Old November 22nd, 2002, 08:47 PM
michaelsanford's Avatar
Translator, Web Developer
 
Join Date: Oct 2002
Location: Ottawa/Montréal
Posts: 2,278
Thanks: 0
Thanked 4 Times in 4 Posts
michaelsanford is on a distinguished road
Does `ditto` follow symlinks?

I know this might be a dumb question, and the answer's probably yes, but does ditto follow links and copy their contents as well, or does it just make a symlink to the original item on the destination and not follow?

I ask because I have a symlink in my home folder that points to my back-up firewire drive. Now if I back up my home folder to my back-up drive... kaboom?

Thanks!
__________________
michaelsanford.comIdenti.ca
• iMac Aluminum 24" |
MacOS X 10.5 (current) | 3.06 GHz Intel Core Duo | 4 GB RAM, 1 TB HDD
• Acer AspireOne 1.60 GHz | Windows XP Home | 1 GB RAM, 100 GB HDD
• AMD Athlon64 3500+ | Ubuntu
-server x86_64 | 1240 GB RAID
Reply With Quote
  #2  
Old November 23rd, 2002, 03:48 AM
scruffy's Avatar
Notorious Olive Counter
 
Join Date: Dec 2000
Location: Soviet Canuckistan
Posts: 1,726
Thanks: 0
Thanked 0 Times in 0 Posts
scruffy is on a distinguished road
My impression from the manpage is that it doesn't really do either - it copies the symlinks exactly as they are.

I apologize if I'm explaining what you already knew, but: symlinks just contain text, which is substituted into the path to be opened. If the symlink text is absolute (i.e. starts with /) then the text replaces the portion of the path resolved so far. If the text is relative (i.e. does not start with /), then the replaces only the last portion of the path resolved so far - the filename of the symlink itself.

So, if /etc is a symlink to "private/etc" (as it is in OS X), and you copied /etc to /other/place using ditto, then revolving "/other/place/etc" would replace just the "etc" part of the path with "private/etc", and look in /other/place/private/etc, which may or may not exist.

If on the other hand, /etc was a symlink to "/private/etc" then resolving "/other/place/etc" would result in "/private/etc" replacing the entire path resolved so far, so it would end up pointing to the same place.
__________________

What is the robbing of a bank compared to the founding of a bank?
-- Bertold Brecht
Reply With Quote
  #3  
Old November 23rd, 2002, 12:24 PM
michaelsanford's Avatar
Translator, Web Developer
 
Join Date: Oct 2002
Location: Ottawa/Montréal
Posts: 2,278
Thanks: 0
Thanked 4 Times in 4 Posts
michaelsanford is on a distinguished road
Yeah scruffy I had a feeling it just copied the link file without following, but I wanted some reassurance.

Never be afraid to explain what one may already know... Thanks!
__________________
michaelsanford.comIdenti.ca
• iMac Aluminum 24" |
MacOS X 10.5 (current) | 3.06 GHz Intel Core Duo | 4 GB RAM, 1 TB HDD
• Acer AspireOne 1.60 GHz | Windows XP Home | 1 GB RAM, 100 GB HDD
• AMD Athlon64 3500+ | Ubuntu
-server x86_64 | 1240 GB RAID
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nfs mounted symlinks renzop Networking & Compatibility 1 May 3rd, 2003 03:03 PM
PureFTPd - don't want to display real path for symlinks... michaelsanford Design & Media 0 March 27th, 2003 12:13 PM
Why don't my symlinks work? michaelsanford Design & Media 6 March 16th, 2003 04:39 PM
Mail.app should follow nettiquette-rules for reply-mails Remco Opinions, & Open Letters 3 May 9th, 2002 04:06 PM
follow your customers links chevy Opinions, & Open Letters 3 November 19th, 2001 12:33 AM


All times are GMT -5. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.