Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f33f44f8274fd6b7fb97712e0afe6a0fb8599197
Ticket: 2806250fffffffffffffffffffffffffffffffff
glob, tilde string representation anomaly
User & Date: juliannoble on 2009-06-17 00:47:38
Changes

  1. icomment:
    Verified that it does occur on Linux (CentOS) with 8.6b1.1
    (but does not occur with 8.5.7 tclkit)
    
    uname -a
    Linux project-open-v33 2.6.18-53.1.21.el4 #1 SMP Tue May 20 09:34:19 EDT 2008 i686 i686 i386 GNU/Linux
    
    This is the 3rd platform I've duplicated the bug on.
    I'll explain it a bit more step by step - as I've found a couple of ways the bug can be hidden.
    
    --------------------------------
    
    create a folder structure  /tmp/working/examine
    
    Make sure the examine folder contains only the ~test.txt  file
    Save the following script as filenames.tcl - into the /tmp/working folder
    
    set folder {/tmp/working/examine}
    set files [glob -dir $folder -type f *]
    foreach f $files {
        #puts [file normalize $f]
        puts "$f exists: [file exists $f]"
    }
    
    
    Make sure you run the script from within /tmp/working 
    As mentioned in my other comment - if you run the script whilst your pwd is /tmp/working/examine - the bug will be masked.  
    
    > cd /tmp/working/filenames.tcl
    > tclsh filenames.tcl
    /tmp/working/examine/~test.txt exists: 0
    
    
    ----------------------------------------------------------
    Note that if you run it with the full path name to the script - you won't see the zero in the output.
    ie it must be called as  'tclsh filenames.tcl'  not 'tclsh /tmp/working/filenames.tcl'
    
    Another weird thing is that if you add the following line to the top of filenames.tcl - then suddenly the bug *does* appear when called as 'tclsh /tmp/working/filenames.tcl'
    
    puts stdout "pwd: [pwd]"
    
    
    It seems to me that it's possibly somewhat different to bug 2511011  because in this case we are supplying the -dir argument to glob and not using -tail,  so we are always dealing with the complete path.  As far as I can see - there should be no tilde/homedir substitution involved in this case.
    
    
    
    
    
    
  2. login: "juliannoble"
  3. mimetype: "text/plain"
  4. resolution changed to: "None"
  5. status changed to: "Open"
  6. username: "juliannoble"