Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-05-21
23:49 • Ticket [3002987fff] new option for glob to behave like unix status still O... artifact: c315a21c3f user: hobbs
2010-05-20
15:46 • Ticket [3002987fff]: 4 changes artifact: 00b75e1bf5 user: dkf
14:33 • Ticket [3002987fff]: 4 changes artifact: 4125594942 user: ferrieux
2010-05-17
22:46 • New ticket [3002987fff]. artifact: 134d83b161 user: coldstore

new option for [glob] to behave like unix

Open3002987fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-05-17 22:46:04
Someone just reported to me that Windows [glob] returns files named .* under [glob *]

This is quite inconvenient, as in this case we're running over a SVN checkout, with .svn directories all over.  I'll have to further-filter the results from [glob] to exclude these.

I'd suggest a -unix 1 option or something so I can make [glob] work just as it does under unix.
ferrieuxplain2010-05-20 14:33:22
Hmmm, what about being bold for once ? At the cost of a minor potential incompatibility, we could continue Tcl's (original) tradition of wiping out platform differences by fixing the Windows side instead of adding yet another platform-specific option...

Is this cost deemed too high ?
dkfplain2010-05-20 15:46:09
By default, [glob] doesn't return hidden files and [glob -types hidden] returns only hidden files. The *real* issue is that your SVN client isn't marking the .svn directories as hidden; that's not Tcl's bug!
hobbsplain2010-05-21 23:49:42
Agreed with dkf - Tcl is doing the "right" thing using native API speak.  Windows has a way to mark files hidden, and Tcl recognizes that.  Starting with '.' means nothing special on Windows.  However, I think these kinds of x-platform peculiarities can and should be abstracted with per-interp vars, like ::tcl::hideDotFiles or something, that control this kind of behavior.  The extra C cost would be negligible, and it would ease overall coding.

Tcl OS X has several such items, but we haven't done it for more platforms.  Maybe it should be tcl::win::hideDotFiles and we can start building these up.
Log in (anonymous is fine) to add a comment.