fanf: (Default)
[personal profile] fanf

What happens if you try to create a symlink to a zero-length target, as in ln -s "" foo?

Linux: ENOENT.

Mac OS X 10.4: EINVAL.

FreeBSD: works, and any attempt to resolve the symlink returns ENOENT.

Solaris: works, and the resulting symlink behaves the same as ln -s . foo

Date: 2008-09-15 20:14 (UTC)
From: [identity profile] zkzkz.livejournal.com
So in trying to justify my intuition I found what I would consider a bug in Bash -- "set -P" shouldn't change the user-visible behaviour of "cd":

$ pwd
/tmp/foo
$ cd ""
$ set -P
$ cd ""
bash: cd: : No such file or directory

But really this is caused by the same disagreement. Bash is behaving as I would expect and assuming chdir("") is a noop. But Linux apparently gives an error.

Date: 2008-09-15 20:16 (UTC)
From: [identity profile] zkzkz.livejournal.com
(Well, except for the way it's documented to, namely the behaviour of ".." of course)

What an abomination, I wonder why I haven't turned it off yet.

July 2025

S M T W T F S
  1 2345
6789101112
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2025-07-11 12:02
Powered by Dreamwidth Studios