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: ":" in filename

Igor Peshansky wrote:
On Sat, 25 Mar 2006, Larry Hall (Cygwin) wrote:
Eric Blake wrote:

It would be nice if cygwin could be more proactive in recognizing : as
invalid in non-managed mounts, rather than passing the : on to the
Windows filename functions, in order to avoid the creation of
undeletable filenames such as ".new." via the help of a colon, but I
can live with the current behavior if adding such a check would slow
down the common case.
The latter affect is certainly the case here though, as usual, I'm sure
it's a PTC if someone has a great brainstorm for a way to do this
without the overhead.

Well, normalize_posix_path() (in already scans the whole path
string looking for '\\' -- I can't imagine that adding a check for ':'
would introduce all that much overhead. But, of course, empirical
evidence is always best, and I don't have any at the moment.

Two month ago, I tested an experimental enhancement to 1.5.19-4 which includes such a check.

It adds a new setting to the CYGWIN environment variable:
"ads:deny" - Return EINVAL on path names with ":" (as suggested)
"ads:allow" - Allow path names with ":" (the current behavior)
"ads:list" - Expose ADS is directory listings

$ touch test:one test:two

$ ls

$ CYGWIN=ads:list ls
test test:one test:two

I didn't realize any overhead for the first two settings.
The third setting of course slows down directory listings (~x4), but it allows things like cp/tar'ing files including ADS.

The (very preliminary) patch is here:
Due to the substantial changes to, the patch is not compatible with current CVS.
But the small test for ":" in may still work ;-)


-- Unsubscribe info: Problem reports: Documentation: FAQ:

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