Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ...

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Aug 27 16:28:00 GMT 2019


On Aug 27 14:51, Houder wrote:
> L.S.,
> 
> # note: cygdrive has been remapped to /drv at my place
> 
> 64-%% uname -a
> CYGWIN_NT-6.1 Seven 3.0.7(0.338/5/3) 2019-04-30 18:08 x86_64 Cygwin
> 64-%% mkdir /drv/e
> mkdir: cannot create directory ‘/drv/e’: Permission denied
> 
> 64-@@ uname -a
> CYGWIN_NT-6.1 Seven 3.1.0(0.340/5/3) 2019-08-19 10:13 x86_64 Cygwin
> 64-@@ mkdir /drv/e
> mkdir: cannot create directory ‘/drv/e’: File exists
> 
> Different error report (which was the objective of Ben Wijen):
> 
>     https://cygwin.com/ml/cygwin-patches/2019-q2/msg00136.html
> 
> Now, let's play:
> 
> 64-@@ cygpath -w /drv/e
> E:\
> 
> 64-@@ mkdir 'e:\' # creates subdirectory e: !!!!!
> 64-@@ rmdir 'e:\' # fails, because it refers to /drv/e
> rmdir: failed to remove 'e:\': Directory not empty
> 
> 64-@@ rmdir 'e:'
> 
> Yes, I should NOT use "DOS paths" ...
> 
>     https://cygwin.com/cygwin-ug-net/using.html#pathnames-win32
> 
> However, I wonder why e:\ is interpreted by mkdir as e:, and as
> /drv/e (that is as e:\) by rmdir.
> 
> Any reason for this remarkable difference?

mkdir(2) has some special code from 2009 which drops trailing
{back}slashes to perform a bordercase in mkdir Linux-compatible.
This code snippet doesn't exist in rmdir(2).


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190827/ccfa8089/attachment.sig>


More information about the Cygwin mailing list