bug-coreutils
[Top][All Lists]
Advanced

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

bug#41001: mkdir: cannot create directory ‘test’: File exists


From: Jonny Grant
Subject: bug#41001: mkdir: cannot create directory ‘test’: File exists
Date: Fri, 1 May 2020 16:06:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

Hello!

Can this error message be clarified? The directory already exists, it is not a file.

lib/mkdir-p.c:200 contains this line of code that triggers below:-

error (0, mkdir_errno, _("cannot create directory %s"), quote (dir));

As it's easy enough to know that the reason mkdir fails is because 'test' a directory that already exists.

Easy enough to check with stat() and S_ISDIR(sb.st_mode)

Can this be changed? Maybe I can make a patch for it.
Jonny



$ mkdir test
$ mkdir test
mkdir: cannot create directory ‘test’: File exists
$ mkdir --version
mkdir (GNU coreutils) 8.28
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
$





reply via email to

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