From: Houder <houder@xs4all.nl>
To: cygwin@cygwin.com
Cc: eblake@redhat.com
Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ...
Date: Wed, 28 Aug 2019 22:57:00 -0000 [thread overview]
Message-ID: <79c3029bece494538245687c26fccf29@smtp-cloud7.xs4all.net> (raw)
In-Reply-To: <27047198-dba4-091b-8235-fc9150b68fbe@redhat.com>
On Wed, 28 Aug 2019 08:33:05, Eric Blake wrote:
> On 8/27/19 7:51 AM, Houder wrote:
>
>
> > 64-@@ mkdir 'e:\' # creates subdirectory e: !!!!!
>
> Had you typed:
>
> mkdir 'e:/'
>
> I would expect subdirectory ./e: to be created. But with 'e:\', that
> is a DOS style path, so I would lean towards requiring './e:\' if you
> want to create a literal directory named 'e:\', but without the leading
> ./ to merely treat 'e:\' as the drive letter and failing with EEXIST
> because /cygdrive/e already exists.
>
> So it sounds like mkdir() could be further improved when something ends
> in \ rather than in /. (The behavior when ending in / should not be
> changed, though).
>
> > 64-@@ rmdir 'e:\' # fails, because it refers to /drv/e
> > rmdir: failed to remove 'e:\': Directory not empty
>
> That matches what I would expect - because you did not pass a leading
> './', but used a backslash, you used a DOS style path and should be
> attempting to act on /cygdrive/e.
>
>
> > 64-@@ rmdir 'e:'
>
> This, however, is not a DOS path, so it should prefer to act on './e:'
> if that exists (and only if it does not exist, then we might consider
> ALSO seeing if /cygdrive/e exists before giving up completely).
>
>
> > 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.
>
> mkdir 'e:/' is supposed to be identical to mkdir 'e:'. The problem is
> that because we interchange \ with / in a number of places, we have
> accidentally ended up with mkdir 'e:\' behaving like mkdir 'e:/' instead
> of acting on the DOS path.
# note: cygdrive has been remapped to /drv at my place
Good gracious! (btw, thank you for the explanation)
- 'e:\' is a DOS path
- e:/ is not a DOS path (removing the trailing /, yields e:)
However, ls -ld e:/ refers to /drv/e
(e:/ is interpreted as 'e:\' by ls!)
So do rmdir, stat, touch ... (and many other commands)
They are all wrong ... Correct?
How about e:/foo ????? A DOS path? Does it refer to /drv/e/foo?
According to
https://cygwin.com/cygwin-ug-net/using.html#pathnames-win32
it is a DOS path (and NOT foo in subdirectory e:)
Said differently, e: is a subdirectory, and e:/ is the same thing,
because a trailing forward slash is ignored (like Linux does).
Correct?
Henri
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
prev parent reply other threads:[~2019-08-28 22:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 15:25 Houder
2019-08-27 16:28 ` Corinna Vinschen
2019-08-27 17:01 ` Houder
2019-08-27 17:32 ` Vince Rice
2019-08-27 17:50 ` Corinna Vinschen
2019-08-28 7:16 ` Houder
2019-08-28 9:22 ` john doe
2019-08-28 11:47 ` Houder
2019-08-28 13:22 ` Corinna Vinschen
2019-08-28 14:16 ` Eric Blake
2019-08-28 14:22 ` Corinna Vinschen
2019-08-28 15:18 ` Corinna Vinschen
2019-08-29 15:19 ` Houder
2019-08-30 8:20 ` Corinna Vinschen
2019-08-30 12:42 ` Houder
2019-09-01 17:38 ` Houder
2019-09-02 8:15 ` Corinna Vinschen
2019-09-03 8:40 ` Houder
2019-09-03 6:50 ` Andrey Repin
2019-09-19 19:51 ` Ken Brown
2019-09-20 9:11 ` Houder
2019-09-20 18:20 ` Houder
2019-09-21 16:07 ` Ken Brown
2019-09-22 7:34 ` Houder
2019-09-22 14:12 ` Ken Brown
2019-09-07 3:47 ` L A Walsh
2019-08-27 19:48 ` Achim Gratz
2019-08-27 20:58 ` Brian Inglis
2019-08-28 7:16 ` Corinna Vinschen
2019-08-27 22:21 ` Achim Gratz
2019-08-28 13:36 ` Eric Blake
2019-08-28 22:57 ` Houder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79c3029bece494538245687c26fccf29@smtp-cloud7.xs4all.net \
--to=houder@xs4all.nl \
--cc=cygwin@cygwin.com \
--cc=eblake@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).