Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-22
17:19 • Ticket [3023017fff] win32 file isdirectory <dir>/* broken. status stil... artifact: b97480fab9 user: serhiy.storchaka
2026-10-21
10:03 • Closed ticket [3023017fff]. artifact: 6d41ebe510 user: serhiy.storchaka
2010-06-30
22:46 • Ticket [3023017fff]: 4 changes artifact: bb3b101249 user: andreas_kupries
19:32 • Ticket [3023017fff]: 4 changes artifact: 17ff49428e user: dgp
04:20 • Ticket [3023017fff]: 4 changes artifact: 480fd54b68 user: andreas_kupries
04:16 • Ticket [3023017fff]: 4 changes artifact: 7712cac4d9 user: andreas_kupries
04:13 • Add attachment session.txt to ticket [3023017fff] artifact: f2e46eb0e5 user: andreas_kupries
04:13 • Ticket [3023017fff] win32 file isdirectory <dir>/* broken. status stil... artifact: dd543baab7 user: andreas_kupries
2010-06-29
21:12 • New ticket [3023017fff]. artifact: 05deabe12d user: andreas_kupries

win32 file isdirectory <dir>/* broken.

Closed / Fixed3023017fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 41 days ago
Descriptionplain2010-06-29 21:12:59
Tracking down a problem in the AT build system I came across this bug in Tcl 8.6 HEAD as the underlying cause. The attached example session demonstrates it, 'file isdirectory' wrongly returning 1 for a non-existing path of the form '<dir>/*' (i.e. the last component is the * glob character'. This bug does not occur in Tcl 8.5, nor does it occur on Linux. It is specific to the win32 platform.

A bisection search of the trunk showed that the problem was introduced between Nov 18, 2009 (ok) and Nov 25, 2009 (fail). My apologies for not providing a smaller interval. The CVS contents fail to build on Windows between Nov 19 to Nov 24.

Still, reading the ChangeLog for this interval the one change standing out to me is

2009-11-24  Pat Thoyts  <[email protected]>

        * tests/fCmd.test: [Bug 2893771]: Teach [file stat] to handle locked
        * win/tclWinFile.c: files so that [file exists] no longer lies.

which is the reason for the initial maintainer assignment.

All other changes look unrelated, with Jan's changes to the win/ build-system accounting for the interval of build failures.
andreas_kupriesplain2010-06-30 04:13:00
File Added - 378779: session.txt
andreas_kupriesplain2010-06-30 04:16:12
Oops, failure to build is til Nov 23, Nov 24 builds and has the problem.
andreas_kupriesplain2010-06-30 04:20:30
More info, now that I am looking at the code and other info ...
SF commit message of the change says
"[...] resorting to FindFirstFile when GetFileAttributes fails."
I wonder if that tries to interpret the glob character ?
Because the call is fine if I use a regular character for the non-existing file in the directory.

The CVS diff is
http://tcl.cvs.sourceforge.net/viewvc/tcl/tcl/win/tclWinFile.c?r1=1.98&r2=1.99
dgpplain2010-06-30 19:32:39
If you revert that CVS diff from the HEAD, does it
fix the bug in the HEAD?
andreas_kupriesplain2010-06-30 22:46:56
Testing ... Yes, after reversion of that diff the 'file isdirectory' behaves correctly again.
Of course, this also resurrects [Bug 2893771], although I haven't checked that.
serhiy.storchakawiki2026-10-21 10:03:39

Fixed in 8.6.1 by [5567ed9fa5] (ticket [3608360]): the FindFirstFile fallback, which expanded the *, is now used only for sharing violations. On Windows 11, 8.6.0 still returns 1 for file isdirectory dir/*; 8.6.1, 8.6.18, 9.0.5 and 9.1 return 0.

serhiy.storchaka Ticket [3023017fff]: 3 changes [History diff]2026-10-22 17:19:31
Log in (anonymous is fine) to add a comment.

Attachments: