Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1f5e42fdcd51696de89e769f72fd452fc720a3ae
Ticket: 1074671fffffffffffffffffffffffffffffffff
handling of ~ in variables used as file names
User & Date: ralfixx on 2004-11-28 15:14:09
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Preparation: create a file starting with tilde
    $ touch ./~foo
    
    $ tclsh8.4
    % info patchlevel
    8.4.6
    
    Setting and using a regular string variable with that
    file name fails:
    % set file ~foo
    ~foo
    % file tail $file
     user "foo" doesn't exist
    
    Using the result of glob succeeds though:
    % set file2 [lindex [glob *foo] 0]
    ~foo
    % file tail $file2
    ./~foo
    
    The variables file and file2 compare equal, but file
    tail gives different results:
    % string equal $file $file2
    1
    % file tail $file2
    ./~foo
    % file tail $file
    user "foo" doesn't exist
    
    When the glob-variable is manipulated in any way, the
    file command fails, too:
    % append file2 {}
    ~foo
    % file tail $file2
    user "foo" doesn't exist
    
    I would have expected to get consistent results in all
    cases, regardless of whether the variable was the
    result of a glob or not.
    
    R'
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "ralfixx"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to: "handling of ~ in variables used as file names"
  11. type changed to: "Bug"