handling of ~ in variables used as file names
Closed / Fixed1074671fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-11-28 15:14:09
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'
dkf Ticket [1074671fff]: 3 changes
[History diff]2004-11-29 00:13:10
vincentdarleyplain2004-12-03 01:46:16
Logged In: YES user_id=32170 Fixed (in 8.4 and 8.5) -- thanks!
Log in (anonymous is fine) to add a comment.