Hi,
ln (GNU coreutils 5.1.1) on Linux 2.4.x, when given the command
ln -sf foo symlink_to_directory
puts the symlink to 'foo' into the directory. I would have expected it to
replace the symlink_to_directory. Rationale:
- http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html
specifies that ln should look at whether the last operand
"does not name an existing directory".
- http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap04.html#tag_04_11
specifies that when a pathname has no trailing slash, pathname resolution
is complete without looking up the target of a symlink, i.e. that lstat()
should be used instead of stat().
The description (info pages) of --no-dereference say:
"The default is to treat a destination that is a symlink to a directory
just like a directory."
Is that consistent with POSIX?
To reproduce:
$ mkdir bar
$ ln -s bar lnk
$ ln -sf foo lnk
$ ls -l lnk foo bar
ls: foo: No such file or directory
lrwxrwxrwx 1 haible users 3 5. Feb 20:30 lnk -> bar
bar:
insgesamt 0
lrwxrwxrwx 1 haible users 3 5. Feb 20:31 foo -> foo
Bruno
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils