Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a6df8d2914b1ae790edceb7986da33ffd78beda7
Ticket: 434876ffffffffffffffffffffffffffffffffff
glob of symlink returns incorrect err
User & Date: vincentdarley on 2001-08-18 00:16:56
Changes

  1. icomment:
    Logged In: YES 
    user_id=32170
    
    glob, or more precisely 'TclDoGlob' in tclFileName.c (near 
    the very end of the file) uses this piece of code to decide 
    whether to add a complete file name (no pattern involved) 
    to the result:
    
        if (Tcl_Access(name, F_OK) == 0) {
    then add to glob result
        }
    
    This differs to the pattern matching code 
    (TclpMatchInDirectory) which will simply add anything 
    returned by the OS 'opendir/readdir' combination, without 
    actually checking whether the file exists (unless you pass 
    in additional '-types' arguments).
    
    So, the solution would seem to be to change that Tcl_Access 
    to something else.  Or at least, if the access fails, to 
    try 'lstat' instead.  Could you test what happens if you 
    replace if (Tcl_Access .. == 0) by 'if (Tcl_LStat(..) == 
    0)'?  (or something like that)....
    
    
    
    
  2. login: "vincentdarley"
  3. mimetype: "text/plain"
  4. username: "vincentdarley"