Artifacts Associated With Ticket 525ccacaef
Ticket change [6f467290dd] (rid 164629) by sebres on 2018-07-13 19:08:21:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
I found very weird discrepancy regarding Tcl_FSStat using 8.6 under Windows for file sub-commands (that use GetStatBuf), depending from used path by "built-in Windows names with dir path and extension". The explanation, what happens, could be provided from this script: <code><pre style="padding-left:10pt; font-size:85%"> proc test_fs_nef {{path {}} {fn this-file-does-not-exists.txt}} { puts "[set fn [file join $path $fn]] ..." puts -nonewline [format [string repeat " %-8s: \[%d\] %s\n" 5] \ atime [catch {file atime $fn} r] $r \ mtime [catch {file mtime $fn} r] $r \ size [catch {file size $fn} r] $r \ stat [catch {file stat $fn stat} r] "$r [array get stat]" \ type [catch {file type $fn} r] $r \ ] } puts [test_fs_nef [info library]] puts [test_fs_nef [info library] CON.txt] puts [test_fs_nef $::env(TEMP)] puts [test_fs_nef $::env(TEMP) CON.txt]; ## here something goes broken!!! </pre></code> results in: <code><pre style="padding-left:10pt; font-size:85%"> <b>D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt ...</b> atime : [1] could not read "D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt": no such file or directory mtime : [1] could not read "D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt": no such file or directory size : [1] could not read "D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt": no such file or directory stat : [1] could not read "D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt": no such file or directory type : [1] could not read "D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt": no such file or directory <b>D:/Projects/tcl8.6-upstream/library/CON.txt ...</b> atime : [1] could not read "D:/Projects/tcl8.6-upstream/library/CON.txt": no such file or directory mtime : [1] could not read "D:/Projects/tcl8.6-upstream/library/CON.txt": no such file or directory size : [1] could not read "D:/Projects/tcl8.6-upstream/library/CON.txt": no such file or directory stat : [1] could not read "D:/Projects/tcl8.6-upstream/library/CON.txt": no such file or directory type : [1] could not read "D:/Projects/tcl8.6-upstream/library/CON.txt": no such file or directory <b>C:/Temp/this-file-does-not-exists.txt ...</b> atime : [1] could not read "C:/Temp/this-file-does-not-exists.txt": no such file or directory mtime : [1] could not read "C:/Temp/this-file-does-not-exists.txt": no such file or directory size : [1] could not read "C:/Temp/this-file-does-not-exists.txt": no such file or directory stat : [1] could not read "C:/Temp/this-file-does-not-exists.txt": no such file or directory type : [1] could not read "C:/Temp/this-file-does-not-exists.txt": no such file or directory <b style="color:red"> C:/Temp/CON.txt ... atime : [1] could not get access time for file "C:/Temp/CON.txt" mtime : [1] could not get modification time for file "C:/Temp/CON.txt" size : [0] 0 stat : [0] mtime 0 atime 0 gid 0 nlink 0 mode 8630 type characterSpecial ctime 0 uid 0 ino 0 size 0 dev -1 type : [0] characterSpecial </b> </pre></code> The guess that something may be wrong on Windows self (e. g. other return code from WinAPI) has not been confirmed: <b>the same script executed for 8.5th returns the expected results in the last case</b> (exactly as for all 3 first cases). It's not the path and file-name alone, because this weird behavior happens only by <b>the combination temp-path together with "CON.txt"</b>. This reflects why the several cmdAH-test-cases fail if used without -tmpdir and successful with -tmpdir parameter. <code><pre style="padding-left:10pt; font-size:85%"> .\tclsh86 ..\..\tests\all.tcl -file "cmdAH.*" cmdAH-20.7.1 FAILED cmdAH-24.14.1 FAILED cmdAH-27.4.1 FAILED cmdAH-28.13.1 FAILED cmdAH-29.6.1 FAILED Total 320 Passed 140 Skipped 175 Failed 5 .\tclsh86 ..\..\tests\all.tcl -file "cmdAH.*" -tmpdir %TEMP% Total 320 Passed 145 Skipped 175 Failed 0 </pre></code> - foundin initialized to: ">= 8.6"
- is_private initialized to: "0"
- login: "sebres"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "sebres"
- subsystem initialized to: "16. Commands A-H"
- title initialized to:
win: strange discrepancy regarding Tcl_FSStat (all file sub-commands using GetStatBuf) corresponding path by "built-in Windows names with dir path and extension"
- type initialized to: "Bug"
Ticket change [f8ffee3bd3] (rid 164630) by bll on 2018-07-13 22:27:28:
- icomment:
Maybe some special case processing for the CON: device that has gone wrong???
- login: "bll"
- mimetype: "text/plain"
- icomment:
Ticket change [ebc4272e14] (rid 164631) by apnadkarni on 2018-07-14 03:32:54:
- icomment:
From the documentation - " If the file does not exist or its access time cannot be queried or set then an error is generated." For the built-in devices like CON on Windows, access and modification times are not maintained. I had changed the code to raise an error accordingly as logged in some old ticket. However, I am fairly certain all tests passed at the time I made the change (it was a while ago) so either these are new tests or something else has changed. /Ashok
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [60c3117667] (rid 164632) by apnadkarni on 2018-07-14 03:35:49:
- icomment:
https://core.tcl.tk/tcl/tktview?name=ae61a67192 is the specific ticket. Change was made in July 2016.
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [2627bf86e2] (rid 164642) by sebres on 2018-07-16 10:33:05:
- icomment:
@Ashok, you've certainly overseen, that all this the test-cases you've made, fail only in if no tmpdir specified (see again the ticket description about the combination where it has different behavior). Neither the test-cases are changed, nor something else (I tested your commit [5e0bded748], it fails likewise if no temp-dir specified.) Which windows-version do you used?
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [60f8f8ca4c] (rid 164643) by apnadkarni on 2018-07-16 13:13:40:
- icomment:
It was two years ago so most likely it would have been either XP or Windows 8 I suspect. I don't think I'd moved to Windows 10 by that time. Also, rethinking the issue I'm wondering whether rather than being pedantic, from a practical point of view it would have been better to have returned 0 as the time instead of raising an error. I still don't feel good about "lying" about the timestamp like that though. Also, I don't think that it is relevant to this specific ticket since you are addressing why the behaviour is *different* in the two cases as opposed to what the specific behaviour is. /Ashok
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [6c10029750] (rid 164644) by sebres on 2018-07-16 13:58:11:
- icomment:
Yep that was the reason. But I found the difference - in case of con.txt in temp-folder the NativeStat does open it with CreateFile (but GetFileInformationByHandle fails) and GetFileType returns 2 (FILE_TYPE_CHAR), so ignored in 8.6 (but returns ENOENT in 8.5). So we can ignore it (as weird Windows hack) and I'll repair the test-cases now.
- login: "sebres"
- mimetype: "text/plain"
- icomment:
Ticket change [b8e69a5fae] (rid 164647) by sebres on 2018-07-16 14:01:13:
- closedate changed to: "2458316.08418762"
- closer changed to: "sebres"
- icomment: "fixed in [d61a95dfb6], this close."
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"