-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 9/18/2009 5:35 AM: > On one hand: > > ln -s dangling link => 0 > stat dangling/ => ENOENT > stat link/ => ENOENT > mkdir link/ => 0
Creating a directory through a slashed symlink works on Solaris 10, and is required by POSIX, but it fails on Linux with EEXIST (in other words, Linux ignores the trailing slash). Unlike the rmdir counterpart (where it is nice that Linux does NOT follow the slashed symlink to remove the dir, leaving a dangling symlink), this seems like a case where the Solaris behavior is nicer. At any rate, now that readlink -f claims that both missing/ and symlink-to-missing/ can resolve, would it make sense to change mkdir(1) to guarantee that 'mkdir symlink-to-missing/' obeys POSIX and creates missing instead of complaining that symlink-to-missing exists? Should I do this via a mkdir(2) wrapper in POSIX (wrapping both mkdir and mkdirat because Linux does not comply), or just in coreutils? - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq6HoIACgkQ84KuGfSFAYDMugCgjWkMxs0X5ObnMzN3DR+eBZFw U+oAmwfHwVwu5ITadXCJKDnVyVq/PWLY =62t3 -----END PGP SIGNATURE-----