Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b24b092655081e29a8873ce7b96f3e7889b3b626
Ticket: 2834453fffffffffffffffffffffffffffffffff
Bug in handling "special" characters in [file] function
User & Date: exgerhardr on 2009-08-13 03:50:14
Changes

  1. icomment:
    Additional comments to "special characters" and tilde expansion:  
    
    In 8.5.7 $,[,] is interpreted correct but the interaction between tilde is "strange".
    
    === 1: File: /net/pub/WinXP/test/~[filename].txt ===
    [file exist $f]-> 0 
    [file type $f]-> could not read "/net/pub/WinXP/test/~[filename].txt": no such file or directory
    [file type [file normalize $f]]-> file
    [file type [subst -nocommands $f]]-> file
    
    You see that [subst -nocommands $f] also circumvents the error like [file normalize $f].
    
    Same with the file which begins with "~$":
    === 0: File: /net/pub/WinXP/test/~$filename.txt ===
    [file exist $f]-> 0 
    [file type $f]-> could not read "/net/pub/WinXP/test/~$filename.txt": no such file or directory
    [file type [file normalize $f]]-> file
    [file type [subst -novariables $f]]-> file
    
    Also here [subst -novariables $f] circumvents the error.
    
    Tilde expansion only is for "expanding" the beginning of the file and not inside of a file path and in csh also "quoting" is possibe (but not in tclsh).
    
    gerhardr@nserver:/net/pub/WinXP/test>csh
    nserver:/net/pub/WinXP/test> ls ~filename.txt
    Unknown user: filename.txt.
    nserver:/net/pub/WinXP/test> ls '~filename.txt'
    ~filename.txt
    nserver:/net/pub/WinXP/test> cd ..
    nserver:/net/pub/WinXP> ls /net/pub/WinXP/test/~filename.txt
    /net/pub/WinXP/test/~filename.txt 
    
    
  2. login: "exgerhardr"
  3. mimetype: "text/plain"
  4. username: "exgerhardr"