Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 161b58bdd8b875076aed380abf312f3fed502250
Ticket: 2806250fffffffffffffffffffffffffffffffff
glob, tilde string representation anomaly
User & Date: juliannoble on 2009-06-14 16:57:33
Changes

  1. assignee changed to: "vincentdarley"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
      When a filename contains a tilde character 'file exists' may falsely return zero.
      The bug occurs when the filename as returned from glob is used.
      Any call to 'file normalize' - even without using the returned value will cause a subsequent 'file exists' to correctly return 1.
    
      When the path is entered directly in tclsh, or hardcoded into a script, file exists correctly returns 1.
    
      set folder {/usr/local/test/} 
      set files [glob -dir $folder -type f *] 
      foreach f $files { 
          #puts [file normalize $f] 
          puts "$f exists: [file exists $f]" 
      } 
    
    
    Simply create a text file with the name "~test.txt" in the test 
    folder. 
    
    
    With the 1st puts commented, the output is: 
    /usr/local/test/~test.txt exists: 0 
    
    
    With the puts uncommented, the output is: 
    /usr/local/test/~test.txt 
    /usr/local/test/~test.txt exists: 1 
    
    
    Tested on FreeBSD  8.6b1.1 2009-06-14 checkout.
    
    
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "juliannoble"
  10. subsystem changed to: "37. File System"
  11. title changed to:
    glob, 'file exists', 'file normalize' interaction with tilde
    
  12. type changed to: "Bug"