Marcus Nutzinger <[EMAIL PROTECTED]> writes: > But if I do the same, just with the -s option to create a symlink, the > following happens: > > $ ls -l > drwx------ 2 nuuz nuuz 4,0K 2007-11-01 15:13 dir > -rw------- 1 nuuz nuuz 0 2007-11-01 15:13 file > $ ln -s file dir/ > $ ls -l dir > lrwxrwxrwx 1 nuuz nuuz 1 2007-11-01 15:14 file -> file > > So "file" points to itself and not to "../file" as I would expect it > after creating the link.
A symbolic link is just that: symbolic. The symlink target is merely a string that is interpreted only at the time the symlink is followed, other than that it has no inherent meaning at all. It does not even have to point to a valid file name, if you never try to follow the symlink you can put any kind of interpretation on the name of the target. For example, you can use a symlink as a kind of lock, encoding the owner pid into its target name. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
