public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Cygwin and x: directory
@ 2013-07-12 20:45 Nellis, Kenneth
  2013-07-15 11:13 ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Nellis, Kenneth @ 2013-07-12 20:45 UTC (permalink / raw)
  To: cygwin

On 07/12/2013 08:42 AM, Mikko Rapeli wrote:
>
> Hi Cygwin and git developers,
>
> Does following scenario show signs of bugs in Cygwin and/or git?
>
> # setup git repo
> $ cd /tmp
> $ mkdir foo && cd foo
> $ git init
>
> # create x: directory
> $ mkdir x:
> $ ls
> x:

IMHO, this makes an interesting problem (unrelated to git):
Shell script prompts user for file name.
User enters "x:".
Script proceeds as follows:
$ mkdir tmpdir
$ touch tmpdir/x:
$ # useful work done here
$ rm -r tmpdir
rm: cannot remove `tmpdir/x:': No such file or directory
rm: cannot remove `tmpdir': Directory not empty
$

It would seem that touch and rm are following different
rules regarding how files may be named.

--Ken Nellis

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cygwin and x: directory
  2013-07-12 20:45 Cygwin and x: directory Nellis, Kenneth
@ 2013-07-15 11:13 ` Corinna Vinschen
  2013-07-15 11:20   ` Adam Dinwoodie
  2013-07-16  3:45   ` Andrey Repin
  0 siblings, 2 replies; 5+ messages in thread
From: Corinna Vinschen @ 2013-07-15 11:13 UTC (permalink / raw)
  To: cygwin

On Jul 12 20:09, Nellis, Kenneth wrote:
> On 07/12/2013 08:42 AM, Mikko Rapeli wrote:
> >
> > Hi Cygwin and git developers,
> >
> > Does following scenario show signs of bugs in Cygwin and/or git?
> >
> > # setup git repo
> > $ cd /tmp
> > $ mkdir foo && cd foo
> > $ git init
> >
> > # create x: directory
> > $ mkdir x:
> > $ ls
> > x:
> 
> IMHO, this makes an interesting problem (unrelated to git):
> Shell script prompts user for file name.
> User enters "x:".
> Script proceeds as follows:
> $ mkdir tmpdir
> $ touch tmpdir/x:
> $ # useful work done here
> $ rm -r tmpdir
> rm: cannot remove `tmpdir/x:': No such file or directory
> rm: cannot remove `tmpdir': Directory not empty
> $

That's a problem of how recursive rm works.  It chdir's into 
the subdirs it's working on and then calls "x:" which is recognized
as drive prefix of a windows path.  `rm ./x:' works as expected.

> It would seem that touch and rm are following different
> rules regarding how files may be named.

No.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cygwin and x: directory
  2013-07-15 11:13 ` Corinna Vinschen
@ 2013-07-15 11:20   ` Adam Dinwoodie
  2013-07-15 11:41     ` Corinna Vinschen
  2013-07-16  3:45   ` Andrey Repin
  1 sibling, 1 reply; 5+ messages in thread
From: Adam Dinwoodie @ 2013-07-15 11:20 UTC (permalink / raw)
  To: cygwin

On 15 July 2013 11:40, Corinna Vinschen wrote:
> On Jul 12 20:09, Nellis, Kenneth wrote:
>> IMHO, this makes an interesting problem (unrelated to git):
>> Shell script prompts user for file name.
>> User enters "x:".
>> Script proceeds as follows:
>> $ mkdir tmpdir
>> $ touch tmpdir/x:
>> $ # useful work done here
>> $ rm -r tmpdir
>> rm: cannot remove `tmpdir/x:': No such file or directory
>> rm: cannot remove `tmpdir': Directory not empty
>> $
>
> That's a problem of how recursive rm works.  It chdir's into
> the subdirs it's working on and then calls "x:" which is recognized
> as drive prefix of a windows path.  `rm ./x:' works as expected.

Does that mean this is a bug in Cygwin rm that ought to be fixed
(subject to SHTDI), or that it's a limitation of Cygwin rm for which
the cure looks to be worse than the symptoms?

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cygwin and x: directory
  2013-07-15 11:20   ` Adam Dinwoodie
@ 2013-07-15 11:41     ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2013-07-15 11:41 UTC (permalink / raw)
  To: cygwin

On Jul 15 12:00, Adam Dinwoodie wrote:
> On 15 July 2013 11:40, Corinna Vinschen wrote:
> > On Jul 12 20:09, Nellis, Kenneth wrote:
> >> IMHO, this makes an interesting problem (unrelated to git):
> >> Shell script prompts user for file name.
> >> User enters "x:".
> >> Script proceeds as follows:
> >> $ mkdir tmpdir
> >> $ touch tmpdir/x:
> >> $ # useful work done here
> >> $ rm -r tmpdir
> >> rm: cannot remove `tmpdir/x:': No such file or directory
> >> rm: cannot remove `tmpdir': Directory not empty
> >> $
> >
> > That's a problem of how recursive rm works.  It chdir's into
> > the subdirs it's working on and then calls "x:" which is recognized
> > as drive prefix of a windows path.  `rm ./x:' works as expected.
> 
> Does that mean this is a bug in Cygwin rm that ought to be fixed
> (subject to SHTDI), or that it's a limitation of Cygwin rm for which
> the cure looks to be worse than the symptoms?

It's a limitation in Cygwin itself.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cygwin and x: directory
  2013-07-15 11:13 ` Corinna Vinschen
  2013-07-15 11:20   ` Adam Dinwoodie
@ 2013-07-16  3:45   ` Andrey Repin
  1 sibling, 0 replies; 5+ messages in thread
From: Andrey Repin @ 2013-07-16  3:45 UTC (permalink / raw)
  To: Corinna Vinschen

Greetings, Corinna Vinschen!

> On Jul 12 20:09, Nellis, Kenneth wrote:
>> On 07/12/2013 08:42 AM, Mikko Rapeli wrote:
>> >
>> > Hi Cygwin and git developers,
>> >
>> > Does following scenario show signs of bugs in Cygwin and/or git?
>> >
>> > # setup git repo
>> > $ cd /tmp
>> > $ mkdir foo && cd foo
>> > $ git init
>> >
>> > # create x: directory
>> > $ mkdir x:
>> > $ ls
>> > x:
>> 
>> IMHO, this makes an interesting problem (unrelated to git):
>> Shell script prompts user for file name.
>> User enters "x:".
>> Script proceeds as follows:
>> $ mkdir tmpdir
>> $ touch tmpdir/x:
>> $ # useful work done here
>> $ rm -r tmpdir
>> rm: cannot remove `tmpdir/x:': No such file or directory
>> rm: cannot remove `tmpdir': Directory not empty
>> $

> That's a problem of how recursive rm works.  It chdir's into 
> the subdirs it's working on and then calls "x:" which is recognized
> as drive prefix of a windows path.

Or a file stream with empty name.
Which isn't allowed either, AFAIK.

> `rm ./x:' works as expected.

>> It would seem that touch and rm are following different
>> rules regarding how files may be named.

> No.


> Corinna



--
WBR,
Andrey Repin (anrdaemon@freemail.ru) 15.07.2013, <23:42>

Sorry for my terrible english...


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-15 21:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12 20:45 Cygwin and x: directory Nellis, Kenneth
2013-07-15 11:13 ` Corinna Vinschen
2013-07-15 11:20   ` Adam Dinwoodie
2013-07-15 11:41     ` Corinna Vinschen
2013-07-16  3:45   ` Andrey Repin

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