[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ln "" foo gives misleading error message
From: |
Ken Irving |
Subject: |
ln "" foo gives misleading error message |
Date: |
Mon, 14 Jan 2013 20:22:52 -0900 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
I've been using symbolic links in a non-file-related way, e.g., to store
arbitrary string values, but find that if I try to create a symlink with
an empty 'target' name, e.g., as 'ln -s "" foo', the error message emitted
is not really correct.
$ ln -s "" foo
ln: creating symbolic link `foo' -> `': No such file or directory
$ ln -sf "" foo
ln: creating symbolic link `foo' -> `': No such file or directory
A link can be created when no file or directory exists, e.g.,
$ stat x || ln -s x foo && echo ok
stat: cannot stat `x': No such file or directory
ok
so it seems that 'No such file or directory' must not be the actual
reason for the failure. Perhaps something like 'null target name'
would be more accurate?
I only happened upon this in working on a test script, and have no
expectation for the operation to succeed.
Thanks
Ken Irving
- ln "" foo gives misleading error message,
Ken Irving <=