Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 29a863dcf42bb6d256aae9d95e29dccb75ac84b3
Ticket: 979879ffffffffffffffffffffffffffffffffff
file isdirectory causing variable corruption?
User & Date: ajpasadyn on 2004-06-25 17:36:03
Changes

  1. assignee changed to: "vincentdarley"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    After a call to "file isdirectory" certain paths no longer 
    seem to exist.  I observed this with Tcl 8.4.x on Win32, 
    but not with Tcl 8.3.x.  Something must be happening to 
    the variable that is passed to file isdirectory.  If I make 
    sure that it's just a temporary string (as in TestFind2) 
    the problem does not occur.
    
    Example:
    
    proc TestFind1 {d f} {
        set r1 [file exists [file join $d $f]]
        puts "TF1: [file join $d $f] found: $r1"
        puts "TF1: is dir a dir? [file isdirectory $d]"
        set r2 [file exists [file join $d $f]]
        puts "TF1: [file join $d $f] found: $r2"
        puts ""
    }
    proc TestFind2 {d f} {
        set r1 [file exists [file join $d $f]]
        puts "TF2: [file join $d $f] found: $r1"
        puts "TF2: is dir a dir? [file isdirectory [file join $d]]"
        set r2 [file exists [file join $d $f]]
        puts "TF2: [file join $d $f] found: $r2"
        puts ""
    }
    
    file mkdir [file join a b c]
    TestFind1 a [file join b . c]
    TestFind2 a [file join b . c]
    
    
    
    
    My output:
    TF1: a/b/./c found: 1
    TF1: is dir a dir? 1
    TF1: a/b/./c found: 0
    
    TF2: a/b/./c found: 1
    TF2: is dir a dir? 1
    TF2: a/b/./c found: 1
    
    
  4. foundin changed to: "obsolete: 8.4.6"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "ajpasadyn"
  9. subsystem changed to: "37. File System"
  10. title changed to: "file isdirectory causing variable corruption?"
  11. type changed to: "Bug"