Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2006-07-22
02:13 • Ticket [1484427fff] glob: retrieve hidden and non-hidden in one go status st... artifact: 8af6ce9eb2 user: blacksqr
2006-05-10
10:11 • Ticket [1484427fff]: 4 changes artifact: 2db29ce782 user: das
05:52 • Ticket [1484427fff]: 5 changes artifact: b453707856 user: vincentdarley
00:18 • Ticket [1484427fff]: 2 changes artifact: cc477a5981 user: dgp
00:17 • Ticket [1484427fff]: 6 changes artifact: d1f140e8fc user: dgp
2006-05-09
23:38 • Ticket [1484427fff]: 4 changes artifact: acf6482025 user: hobbs
18:37 • Ticket [1484427fff]: 4 changes artifact: 21a3f93899 user: nobody
07:05 • New ticket [1484427fff]. artifact: 47d8701e2f user: nobody

glob: retrieve hidden and non-hidden in one go

Open1484427fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 20 years ago
Descriptionplain2006-05-09 07:05:14
It is not possible to list a hidden file with glob.
A -all option would be suitable
nobodyplain2006-05-09 18:37:21
Logged In: NO 

Please do try reading the glob documentation where you will
find '-types hidden' clearly documented.
hobbsplain2006-05-09 23:38:44
Logged In: YES 
user_id=72656

The -types hidden is what's documented, but glob is broken
in that you can't get hidden and non-hidden items in one
request, and glob's can be expensive.  A -all is a good idea.
dgpplain2006-05-10 00:17:12
data_type - 360894
dgp Ticket [1484427fff]: 2 changes [History diff]2006-05-10 00:18:11
vincentdarleyplain2006-05-10 05:52:17
Logged In: YES 
user_id=32170

Changed the summary to reflect what this is actually about.

Indeed that is a good idea, and I heartily recommend someone
write a TIP and provide a patch to implement this.

I do have to ask, however, whether there are good examples
when glob really is the performance bottleneck?  Clearly
almost any situation where the files are actually going to
be accessed in any way is going to mean that the 'glob'
itself will be relatively quick in comparison.
dasplain2006-05-10 10:11:22
Logged In: YES 
user_id=90580

note the added wrinkle on Mac OS X of the HFS invisible flag in this context, 
c.f. bug 823329:

> the only thing not implemented is exclusion of
> files hidden via HFS invisible flag from
> ordinary glob results (i.e. without -types
> hidden), to implement this it would be
> necessary to do always do a costly stat &
> getattrlist for every file traversed (as well
> as a major rewrite of unix
> TclpMatchInDirectory/ NativeMatchType), I don't
> think it's worth the slowdown of the most
> common glob cases to add this minor feature.
> [glob -types hidden] does however return the
> files with HFS invisible flag in addition to
> files starting with '.'

so -all is already the default mode of operation on Darwin for HFS invisible 
files...
blacksqrplain2006-07-22 02:13:18
Logged In: YES 
user_id=128673

I second the request for an "-all" option.  It would be
especially useful for example when dealing with high-latency
network filesystems, where one wants to make as few calls as
possible to maximize performance.

Note also that the Tclvfs API doesn't transmit the "hidden"
type flag to the underlying vfs code, so if one wants to
make hidden files accessible in a virtual filesystem, every
glob call made by a user must be fulfilled with two glob
calls in the vfs code (one to get non-hidden files, another
to get the hidden).  Again, when working over remote
networks, this is an unnecessary performance hit.
Log in (anonymous is fine) to add a comment.