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: Jari Aalto
Subject: Re: coreutils 5.97: Adjust mkdir message (File exists)
Date: Wed, 09 Jan 2008 09:55:55 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (windows-nt)

* Tue 2008-01-08 Jim Meyering <address@hidden>
* Message-Id: address@hidden
> 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.

"Target exists" would be more generic if message is based on the EEXIST
error code.

> 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'd welcome this. When error condition occures, it's a perfect place to
provide more information. The information is not necessarily displayed
to user, but stored to a log file, so when person looks at the logs
later, he can get detailled view of the problem.

I'd estimate that 90% of the cases the messages differentiating:

- File
- Directory
- Symlink
- "Other"

Would suffice in the error messages.

> 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.

Jari

-- 
Welcome to FOSS revolution: we fix and modify until it shines





reply via email to

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