bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils 5.97: Adjust mkdir message (File exists)


From: Jim Meyering
Subject: Re: coreutils 5.97: Adjust mkdir message (File exists)
Date: Tue, 08 Jan 2008 19:05:46 +0100

Jari Aalto <address@hidden> wrote:
> A demonstration:
>
>     mkdir cache/temp
>     mkdir cache/temp
>     mkdir: cannot create directory `cache/tmp': File exists

I presume it wasn't "mkdir" that changed "temp" to "tmp"

> Suggestion:
>
>     Perhaps the "File" is not the best description in this case.
>     Please consider saying "Directory exists" if the item is directory.

Thanks, but "File exists" is just the English version of the
strerror(EEXIST) string from the C library.

For one thing, in discussing file system objects, "file" is often
used to refer to a generic object, be it symlink, block device,
regular file, directory, etc.  But that's not the real issue.

Also, what about when the preexisting thing is a regular file:

  touch f && mkdir f

or a symlink:

  ln -s . f && mkdir f

Should mkdir have to perform an additional lstat so that
it can include the type of the preexisting file system "object"
when the mkdir functions fails with EEXIST?

I'm inclined to say no, but there is precedent for examining the file
type.  The prompt you see when using rm's -i tells you about the type
of the file it might remove.




reply via email to

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