Jim Meyering <[EMAIL PROTECTED]> wrote:
> The behavior of `ln -s' in that case is compatible with
> historical BSD implementations. You'd like the SYSV behavior.
I think a new option would be useful - I'll call it --syntactic, but
that may not be a good name. --syntactic means that the filenames
passed to link() or symlink() (or rename() or open(), as this would
also be useful for mv & cp) are computed entirely from the
command-line parameters, without checking to see what happens to exist
in the filesystem. The target name is treated as a directory (and
thus gets the source basename appended) only if it syntactically ends
with "/". So:
ln --syntactic foo bar # link("foo", "bar"), regardless of what exists now
ln --syntactic -s foo bar/ # symlink("foo", "bar/foo")
mv --syntactic foo bar # rename() will fail if bar is a directory; good!
cp --syntactic foo bar baz # error; baz is not a directory, syntactically
This way, you can easily see that the command will (try to) do what
you intend it to do, without worrying about what might exist already.
If the pre-existing contents of the filesystem make it impossible to
do what you intended to do, you'll get an error instead of some
alternate, unintended behavior.
paul
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils