Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-07-31
10:30 • Closed ticket [997889ffff]: file normalize returns wrong path plus 2 other c... artifact: 8ef08af66c user: dgp
2004-07-27
22:10 • Open ticket [997889ffff]. artifact: 75be2ec64d user: uring
21:11 • Ticket [997889ffff]: 9 changes artifact: 175c797cc8 user: dgp
21:11 • Pending ticket [997889ffff]. artifact: 7849d21b85 user: dgp
2004-07-26
08:43 • New ticket [997889ffff]. artifact: 3da794009c user: uring

file normalize returns wrong path

Closed / Duplicate997889ffffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-07-26 08:43:01
Run this example. It prints "/tmp/foo/bar" instead of
"/tmp/xxx/bar" .

#
-----------------------------------------------------------
cd /tmp                       ;# working directory
file delete -force foo xxx    ;# make clean
file mkdir foo/bar            ;# some directories
file link xxx foo             ;# xxx -> foo

set target xxx/bar            ;# store path of
subdirectory in variable
file isdirectory $target      ;# check xxx/bar
file delete xxx               ;# now delete symlink
file copy foo xxx             ;# recreate as copy of bar

puts [file normalize $target]
#
----------------------------------------------------------

Comments:

(1) uncomment "file isdirectory ..." and it's OK
(2) change to "file isdirectory xxx/bar" and it's OK

I assume that the path /tmp/foo/bar is cached in the
variable "target" (in Tcl_Obj's internal representation).

Having "string length $target" _after_ "file
isdirectory $target"
changes variable to string type and things are OK.


-----
Ulrich Ring - [email protected]
dgp Pending ticket [997889ffff]. [History diff]2004-07-27 21:11:54
dgpplain2004-07-27 21:11:55
Logged In: YES 
user_id=80530


Looks like a Duplicate of 953284
uringplain2004-07-27 22:10:39
Logged In: YES 
user_id=123371


BTW: 

I'm not able to reproduce the bug with tcl8.5a1.
dgp Closed ticket [997889ffff]. [History diff]2004-07-31 10:30:10
Log in (anonymous is fine) to add a comment.