Bug in cygwin's mkdir
Eric Blake
ebb9@byu.net
Tue Aug 23 11:40:00 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Chris Mumford on 8/22/2005 3:02 PM:
> I came across what I believe is an interesting bug.
>
> Let's say I have a file in a directory named "foo.exe". If I run "mkdir
> foo" then it succeeds. If I then run "mkdir -p foo" then it fails. If I
> remove foo.exe then "mkdir -p foo" succeeds.
>
> The error message contains says "foo exists but is not a directory".
Bugs in the cygwin packaging of coreutils should be reported to cygwin AT
cygwin.com. Setting the reply-to: accordingly.
What you are seeing is caused by cygwin's auto-.exe extension behavior,
and is not a bug in the upstream sources. The problem is that on cygwin,
stat(2) on "foo" returns information for "foo.exe" if "foo" did not exist
(a cygwin design decision that helps 99% of the time, since Windows does
not like executables without extensions but Unix does; but it interferes
in this case). The code path for `mkdir -p' uses stat(2) while the code
path for regular `mkdir' does not. Now that you've reported it, the
cygwin team will probably write a cygwin-specific patch to `mkdir -p' to
ignore stat(2) if it appended .exe.
- --
Life is short - so eat dessert first!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDCwsJ84KuGfSFAYARArlHAJ9wx80UqnFoQL/iiYMUUTOo/9vp+wCgo9Cf
/sdnHtBseRG5sGtQ8+aEddQ=
=0vDO
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list