Tcl Source Code

Ticket Change Details
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.
Overview

Artifact ID: 6f467290dd4cfd23483e4c812a6c4f353e779cbd534bee8521f16d0525886be8
Ticket: 525ccacaef84745d0a5ed72060f208626291077c
win: strange discrepancy regarding Tcl_FSStat (all file sub-commands using GetStatBuf) corresponding path by "built-in Windows names with dir path and extension"
User & Date: sebres 2018-07-13 19:08:21
Changes

  1. Change assignee to "nobody"
  2. Change closer to "nobody"
  3. Change cmimetype to "text/x-fossil-wiki"
  4. Change comment 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:

    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!!!

    results in:
    D:/Projects/tcl8.6-upstream/library/this-file-does-not-exists.txt ...
      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
    

    D:/Projects/tcl8.6-upstream/library/CON.txt ... 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

    C:/Temp/this-file-does-not-exists.txt ... 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 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

    The guess that something may be wrong on Windows self (e. g. other return code from WinAPI) has not been confirmed: the same script executed for 8.5th returns the expected results in the last case (exactly as for all 3 first cases). It's not the path and file-name alone, because this weird behavior happens only by the combination temp-path together with "CON.txt".

    This reflects why the several cmdAH-test-cases fail if used without -tmpdir and successful with -tmpdir parameter.

    .\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

  5. Change foundin to ">= 8.6"
  6. Change is_private to "0"
  7. Change login to "sebres"
  8. Change priority to "5 Medium"
  9. Change resolution to "None"
  10. Change severity to "Minor"
  11. Change status to "Open"
  12. Change submitter to "sebres"
  13. Change subsystem to "16. Commands A-H"
  14. Change title 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"

  15. Change type to "Bug"