This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On 2019/08/28 07:22, Corinna Vinschen wrote:
> One problem here is, what to do about border cases like
>
>   $ mkdir a\/\/\/
>
> In theory slashes and backslashes should both be treated as dir
> separators.  Handling a case like this so that all expectations
> are satisfied is next to impossible, I guess.
>   
In a shell or as a quoted literal?  Under POSIX or under Windows?

In a shell it ends up as:

> pathcat a\/\/\/\/ b
a/b
> pathcat a\/\/ b
a/b

But as a quoted string, things don't get reduced unless last of first +
first of second are same:

> pathcat 'a\/\/' 'b'
a\/\/b                  # cuddled
> pathcat 'a\/\/' '/b'
a\/\/b                  # slash reduced
pathcat 'a\/\/' '\/b'
a\/\/\/b                # concat
pathcat 'a\/\' '\/b'
a\/\/\/b               # slash added as "\/b is assumed to be at ./\/b

Note that while posix may specify that mkdir 'a' and 'a/' should be the
same,
'a:' and 'a:\' are not (and would not be POSIX compliant).






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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]