[Top][All Lists]

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

Re: rename("symlink-to-dir/", "name") behavior

From: Eric Blake
Subject: Re: rename("symlink-to-dir/", "name") behavior
Date: Fri, 22 Feb 2008 06:27:31 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Thunderbird/ Mnenhy/

Hash: SHA1

According to Jim Meyering on 2/22/2008 6:09 AM:
|> I wonder if we would have much luck proposing a patch to the Linux kernel
|> folks to do just that?
| Do you see another errno symbol name that makes sense?
| I think that ENOTDIR makes the most sense from a semantic point of view.
| It might be a hard sell.

The POSIX folks argued that ENOTDIR is not appropriate, since in _most_
contexts, symlink-to-dir/ (with the trailing slash) is indeed a directory
according to the pathname resolution rules - it is only when you omit the
trailing slash that it is not a directory; unfortunately, rename and rmdir
have different semantics when you remove the trailing slash.  But they
also agreed that POSIX allows implementations to add additional
restrictions on path resolution, and that as long as Linux does not
violate the semantics of their interpretation of ENOTDIR (ie. uses a
different errno, to make it clear that this is an intentional and addition
implementation restriction of Linux), then the intuitive behavior is
permissible as one of those implementation restrictions.  ENOTSUP sounds
reasonable, otherwise I think we'd have to invent a new one, maybe ESLASH
"trailing slash on symlink"?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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