Tcl Source Code

View Ticket
Login
Ticket UUID: 3023017
Title: win32 file isdirectory <dir>/* broken.
Type: Bug Version: None
Submitter: andreas_kupries Created on: 2010-06-29 21:12:59
Subsystem: 37. File System Assigned To: patthoyts
Priority: 5 Medium Severity:
Status: Open Last Modified: 2010-06-30 22:46:56
Resolution: None Closed By:
    Closed on:
Description:
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.
User Comments: andreas_kupries added on 2010-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.

dgp added on 2010-06-30 19:32:39:
If you revert that CVS diff from the HEAD, does it
fix the bug in the HEAD?

andreas_kupries added on 2010-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

andreas_kupries added on 2010-06-30 04:16:12:
Oops, failure to build is til Nov 23, Nov 24 builds and has the problem.

andreas_kupries added on 2010-06-30 04:13:00:

File Added - 378779: session.txt

Attachments: