Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-15
11:29 • Closed ticket [3048726fff]: Strange glob bad result plus 3 other changes artifact: f603a318b1 user: serhiy.storchaka
2016-08-20
17:07 • Pending ticket [3048726fff]. artifact: fea016b9ba user: dkf
2010-08-23
16:24 • Ticket [3048726fff]: 4 changes artifact: 167b9149a2 user: beric
15:27 • Ticket [3048726fff]: 4 changes artifact: 60f22afaa0 user: ferrieux
14:56 • Ticket [3048726fff]: 4 changes artifact: 9e2a3c7a07 user: beric
2010-08-20
22:58 • Ticket [3048726fff]: 4 changes artifact: 24e648773b user: ferrieux
22:31 • Ticket [3048726fff]: 4 changes artifact: 08cdb9096a user: beric
22:17 • Ticket [3048726fff]: 4 changes artifact: cac040b9b2 user: beric
22:17 • Add attachment glob_with_star.pcap to ticket [3048726fffffffff|3048726f... artifact: ac06d360f0 user: beric
22:17 • Add attachment glob_csv.pcap to ticket [3048726fff] artifact: 079d437f8a user: beric
22:17 • Ticket [3048726fff] Strange glob bad result status still Open with 4 other c... artifact: 4ef98875cb user: beric
21:52 • Open ticket [3048726fff]. artifact: 1fd46720d0 user: ferrieux
21:40 • Closed ticket [3048726fff]. artifact: ac45135d3b user: beric
21:39 • Ticket [3048726fff]: 4 changes artifact: 3f0f2f5101 user: beric
16:52 • Ticket [3048726fff]: 4 changes artifact: 3be902592a user: ferrieux
15:03 • Ticket [3048726fff]: 4 changes artifact: 7017ee2077 user: beric
15:03 • Add attachment traces.txt to ticket [3048726fff] artifact: 83987e9c14 user: beric
15:02 • Ticket [3048726fff] Strange glob bad result status still Open with 4 other c... artifact: 14fbfe1cfe user: beric
2010-08-19
22:45 • Ticket [3048726fff]: 4 changes artifact: 00dd5cde2a user: ferrieux
22:40 • Ticket [3048726fff]: 4 changes artifact: df878e0d89 user: dkf
15:12 • New ticket [3048726fff]. artifact: c56008b9d6 user: beric

Strange glob bad result

Closed / Out of Date3048726fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 49 days ago
Descriptionplain2010-08-19 15:12:43
I encounter a strange problem with glob under windows XP, with a networked mounted drive.
Here is a copy of a tclsh console:

(pai_builder) 8 % glob -directory z:/pai/sorties/861/config_whitebox -tails *
interface.csv memorisation.csv appel.csv variable.csv version.csv
(pai_builder) 9 % glob -directory z:/pai/sorties/861/config_whitebox -tails *.csv
interface.csv memorisation.csv

The first glob with the pattern "*" returns 5 files.
While they all have the .csv extension, only 2 of them are returned by glob with the pattern "*.csv".
dkfplain2010-08-19 22:40:58
Check whether you have any non-printing characters in those filenames?
ferrieuxplain2010-08-19 22:45:22
Reminds me of  http://groups.google.fr/group/comp.lang.tcl/tree/browse_frm/thread/dee9f450a03729f4/ed9e29369fcd9cdb?rnum=1&q=petasis&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2Fdee9f450a03729f4%2F551ba8571083d884%3Flnk%3Dgst%26q%3Dpetasis%26safe%3Dimages%26#doc_ed9e29369fcd9cdb
bericplain2010-08-20 15:02:23
Donal, 
using [string match *.csv] on each file returned by [glob *] returns 1.

Alex, 
thanks to your "strace"answer on c.l.t  (frequent but good advice!) , I used "procmon".
Result attached in traces.txt.

As you can see, even QueryDirectory doesn't give the same result.
bericplain2010-08-20 15:03:28
File Added - 384025: traces.txt
ferrieuxplain2010-08-20 16:52:20
Thanks for the traces :)
Wow ! Indeed QueryDirectory seems to randomly miss files. But since the trace report doesn't give much details on  the parameters (handle values), we're in the dark...
Maybe the next step would be to capture the CMB/CIFS packets exchanged with Wireshark.
Can you attach the pcap ?
bericplain2010-08-20 21:39:41
Alex, thank you very much again!
While I use wireshark to debug my own protocols implemention (when "puts" can't do more!), I wish I had think to it to track down this problem.
So, the capture shows clearly that the samba server is the guilty, by not returning all the files.
It's only my problem now, happy that it's not a Tcl bug.
beric Closed ticket [3048726fff]. [History diff]2010-08-20 21:40:41
ferrieuxplain2010-08-20 21:52:10
Well, the server could be legally shortening the list because of something in the request parameters. While it might not be Tcl's fault, it seems there are repeated issues with [glob] on Windows with network shares. Just in case your case happens to be a facet of this general problem, the analysis could help identify the mechanism, and possibly produce a workaround. Please attach the pcap ;-)
bericplain2010-08-20 22:17:25
File Added - 384065: glob_csv.pcap
bericplain2010-08-20 22:17:57
File Added - 384066: glob_with_star.pcap
bericplain2010-08-20 22:31:37
You're right, here are the captures.
ferrieuxplain2010-08-20 22:58:54
Thanks. 
There's something strange: in the truncated SMB request FIND_FAST2, the  '*'characted (in *.CSV) is replaced by a '<':

   Search Pattern: \pai\sorties\860\config_whitebox\<.CSV

while in the successful one the star is a star:

   Search Pattern: \pai\sorties\860\config_whitebox\*

I'll have to dig a bit further to understand the semantics of this change. Perhaps '<' is another kind of wildcard in SMB...

One thing you could do is try [glob z:/pai/sorties/861/config_whitebox/*.csv] directly. If it works, I'm interested in the pcap too ;-)

Also, the pcap of a similar query from the DOS prompt (dir /s *.csv) could be helpful, especially if it works (which I suspect).
bericplain2010-08-23 14:56:08
"dir *.csv" gives the same result as glob.
Using procmon, it also calls QueryDirectory with *.csv filter.
ferrieuxplain2010-08-23 15:27:49
Ha !!! But how can this bug survive for so long if the Windows crowd is also concerned ???
Maybe it is confined to one specific buggy version of Samba...

(Verification: do you also see the '<' in dir *.csv pcap ? You can just attach it if you prefer)
bericplain2010-08-23 16:24:43
Yes, there is also the < instead of *.
I reported the problem to our IT support service to check the samba configuration.
I'll let you know of the progress...
dkf Pending ticket [3048726fff]. [History diff]2016-08-20 17:07:32
serhiy.storchakawiki2026-10-15 11:29:06

Closing: no reply since 2016.

Log in (anonymous is fine) to add a comment.

Attachments: