bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: readlink(1) behavior


From: Eric Blake
Subject: Re: readlink(1) behavior
Date: Wed, 23 Sep 2009 07:11:30 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----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             address@hidden
-----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-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]