[darcs-users] double dots are not allowed in filenames?

Yitzchak Gale gale at sefer.org
Tue Aug 28 22:10:47 UTC 2007


I wrote:
>> rcp... man page says:
>>    Each file or directory argument is
>>    either a remote file name of the form ``rname at rhost:path'',
>>    or a local file name
>>    (containing no `:' characters, or a `/' before any `:'s).
>> Perhaps darcs should follow that convention.

David Roundy wrote:
> Yeah, checking for '/' before ':' would make a lot of sense.

>> How does darcs distinguish a URL from an rcp-style
>> remote file?
>> ...Am I correct that not every legal URL conforming
> > to RFC 3986 can be accepted?

> Don't URLs always have :// in them?

No. But I think it is reasonable for darcs to recognize
only those that do. So that answers both of my
questions.

>> ..."file:" URLs are allowed to
>> contain ':'. Does darcs support this?

> In the original poster's situation, any URL is invalid,
> and it's a pure and simple darcs bug.

Well, OK, but what is the correct behavior?

I propose the following algorithm:

In contexts where only local paths make sense,
we interpret every file spec as a local path.
(Can that include UNC paths on Windows?
It would be nice.)

Otherwise:

1. If a file spec begins with a valid URI scheme
name followed by "://", it is a URL.

2. If it contains a ':' that is not after a '/', then it is
an rcp-style remote file. (Even on Windows,
for consistency.)

3. Otherwise, it is a local file path (or UNC on
Windows).

Note that according to RFC3986, a valid URI
scheme name is:

scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )


More information about the darcs-users mailing list