[Top][All Lists]

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

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

From: Jim Meyering
Subject: Re: rename("symlink-to-dir/", "name") behavior
Date: Sat, 23 Feb 2008 08:45:51 +0100

Eric Blake <address@hidden> wrote:

> 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"?

Oh!  ENOTSUP sounds ok.  That's probably easier than inventing,
even if ESLASH is more evocative.  For some reason I interpreted
Geoff's words as saying the alternate errno symbol had to be
one of the ones already listed in the ERRORS section.

reply via email to

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