[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Files with trailing dots on Windows

From: Molle Bestefich <molle.bestefich_at_gmail.com>
Date: 2006-02-06 19:14:55 CET

von Löwis Martin wrote:
> Unfortunately, it isn't: there is no easy way to find out whether
> a system supports a certain filename. You would have to hard-code
> rules on a per-system basis.

Yeah, no biggie.

> > The rules are simple too. When checking out files on Windows:
> > - Skip files ending in trailing dots
> > - Skip files with names containing \ / : * ? " < > |
> > - Skip files whose name clashes on a case insensitive
> > filesystem (just skip both/all files to avoid any mistakes).
>
> These rules are incomplete:
> - the names CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5,
> COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6,
> LPT7, LPT8, and LPT9 are reserved, as are filenames that
> extend one of these (such as prn.txt). Case doesn't matter.
> On Windows NT, CLOCK$ is also reserved.

nah:

C:\>dir

 Directory of C:\

06-02-2006 19:02 8 lpt1.txt
06-02-2006 19:02 10 a.txt
06-02-2006 19:02 9 con.txt
06-02-2006 19:02 8 1.txt
06-02-2006 19:02 8 aa$.txt
06-02-2006 19:03 10 clock$
...

Leading spaces, reserved names, dollar signs and all.
No problem there. Guess it's not *that* insane.

> - also skip file names with leading or trailing spaces.

Leading? As per above, not necessary.
Trailing? Yes, that might be right!

Not sure how to test for that though.
If I knew how to test it, I'd try with trailing tabs ass well. Anyone?

But at most we'll end up with the check I wrote above plus a trailing
whitespace check.
So we're still good to go without PCRE or something like that (so
let's not get into that just yet =)).

> Apart from that, I think this strategy would work for Win32,
> and my specific problem would be solved if there was a Win32-only
> solution.

Good!

> For a complete specification, see "Naming a File", in
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp

Don't trust MSDN, it's terminally flawed in a lot of the stuff it documents.

It's of course very good documentation-wise to stuff everything
related into this section called "Naming a file", but unfortunately
the docs fail to accurately indicate what is *really* disallowed by
the OS and what will just yield incompatabilities with DOS emulation
and various broken APIs and apps...

"Do not use the following reserved device names [...]: CON, PRN,
[...]" doesn't exactly say that the OS doesn't support it, just that
you shouldn't do it. *That* we can leave at the discretion of the
Subversion users. As long as the OS supports the filename, let the
user use it if he wants.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 6 19:16:10 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.