From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Could rm remove files and folders with colon in their name?
Date: Wed, 10 Nov 2021 21:39:52 +0100 [thread overview]
Message-ID: <YYwuGBM5JCXoMxZF@calimero.vinschen.de> (raw)
In-Reply-To: <d4cfb303-60d9-e53c-d75f-a96f8fbf11b7@emmenlauer.de>
On Nov 10 21:24, Mario Emmenlauer wrote:
> On 10.11.21 14:49, Corinna Vinschen via Cygwin wrote:
> > On Nov 10 10:45, Mario Emmenlauer wrote:
> >> Could 'rm' support removing files and folders that have a colon ':' in
> >> their name? I.e. I would like that 'rm -fr' would remove a full directory
> >> tree, including such folders. Currently it will correctly remove anything
> >> inside such folders, but not the folder itself.
> >>
> >> As an example, for the following structure:
> >> C:/root/folder/C:/inside/file.txt
> >>
> >> When using 'rm -fr root', afterwards I have:
> >> C:/root/folder/C:
> >
> > It works fine if the folder is called, say, "a:b", it just doesn't
> > work for a name which looks like a drive letter "x:", apparently.
>
> That is indeed interesting, I was not aware of it! Then maybe the
> problem is not so hard to solve? That would be awesome!
To the contrary. The problem is the ambiguity that "X:/foo" might
be either the absolute POSIX path $CWD/X:/foo, or the absolute DOS
path "X:\foo". I have a patch which fixes your case, but not much
else. The problem is that we historically allow DOS paths as input
at all. That was a bad decision from the start, but you can't easily
change 25 years of history...
Corinna
next prev parent reply other threads:[~2021-11-10 20:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 9:45 Mario Emmenlauer
2021-11-10 13:49 ` Corinna Vinschen
2021-11-10 20:24 ` Mario Emmenlauer
2021-11-10 20:39 ` Corinna Vinschen [this message]
2021-11-11 14:00 ` Mario Emmenlauer
2021-11-24 15:40 ` Chris Wagner
2021-11-10 14:49 ` Andrey Repin
2021-11-10 16:35 ` Brian Inglis
2021-11-10 20:23 ` Mario Emmenlauer
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=YYwuGBM5JCXoMxZF@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.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).