Tcl Source Code

View Ticket
Login
2026-10-21
10:03 • Closed ticket [1197447fff]: fCmd-6.26 error when /home is a link plus 4 othe... artifact: 9cecb0ce6a user: serhiy.storchaka
2006-11-12
18:43 • Ticket [1569064fff] different ~ expansions in file causes fCmd 6.26 to fail</i... artifact: a59b7db781 user: das
2006-11-10
23:58 • Ticket [1569064fff]: 4 changes artifact: 1cb7b4d940 user: dgp
11:40 • Ticket [1569064fff]: 4 changes artifact: cfaeb68a08 user: das
11:33 • Ticket [1569064fff]: 5 changes artifact: 12773b3938 user: dgp
2006-10-13
02:06 • Ticket [1569064fff]: 4 changes artifact: a63471a78c user: nobody
01:21 • Ticket [1569064fff]: 4 changes artifact: eeeb6d18d5 user: dgp
00:48 • Ticket [1569064fff]: 4 changes artifact: 08c45f98d5 user: dgp
2006-10-05
01:54 • Ticket [1569064fff]: 4 changes artifact: 8d5f3cc021 user: wliao
00:28 • Ticket [1569064fff]: 4 changes artifact: ed55171afe user: dgp
2006-10-03
01:50 • Ticket [1569064fff]: 2 changes artifact: 12113fa617 user: dgp
2006-10-02
05:27 • New ticket [1569064fff]. artifact: 72a9a9939f user: wliao

Ticket UUID: 1569064
Title: different ~ expansions in [file] causes fCmd 6.26 to fail
Type: Bug Created on: 2006-10-02 05:27:05
Submitter: wliao Assigned to: vincentdarley
Subsystem: 37. File System Severity:
Priority: 5 Medium Last modified: 2006-11-12 18:43:12
Status: Open Closed by:
Resolution: None Closed on:
Version: obsolete: 8.5a4
Description:
The fCmd-6.26 test uses [file dirname ~] and [file tail
~] to construct the test message. This acts like [file
normalize] in expanding the ~ and any symbolic links.
However, the error message from [file copy] behaves like
[file nativename]: the ~ is expanded, but it doesn't seem
to follow the symbolic links. The test on a machine with
symbolic links in ~ will fail like this

  ---- Result was:
  1 {error copying "~/td1" to "td1":
"/home/wl/td1/td2": permission denied}
  ---- Result should have been (exact matching):
  1 {error copying "~/td1" to "td1":
"/d1/home/wl/td1/td2": permission denied}

The error message of [file copy] can be changed, which is
probably a bad idea, or a minor change be made to the test
by wrapping the ~ with [file natiename]:

  tests$ diff fCmd.test fCmd.test.orig
  584c584
  < } "1 {error copying \"~/td1\" to \"td1\": \"[file
join [file dirname [file nativename ~]] [file tail
[file nativename ~]] td1 td2]\": permission denied}"
  ---
  > } "1 {error copying \"~/td1\" to \"td1\": \"[file
join [file dirname ~] [file tail ~] td1 td2]\":
permission denied}"
User Comments:
dgp added on 2006-10-05 00:28:57:
Logged In: YES 
user_id=80530


Do you see the same problem
with 8.4.14 ?

wliao added on 2006-10-05 01:54:17:
Logged In: YES 
user_id=863965

It seems this is the same behavior in 8.4.14:

  ---- Result was:
  1 {error copying "~/td1" to "td1": "/home/wl/td1/td2": 
permission denied}
  ---- Result should have been (exact matching):
  1 {error copying "~/td1" to "td1": "/d1/home/wl/td1/td2":
permission denied}
  ==== fCmd-6.26 FAILED

Here is the output from with tcl (via tcltest):

  % puts $tcl_patchLevel
  8.4.14
  % puts [file normalize ~]; puts [file nativename ~]
  /d1/home/wl
  /home/wl

dgp added on 2006-10-13 00:48:11:
Logged In: YES 
user_id=80530


I'd like to understand the history
better before accepting this change.

That technique for constructing
the expected test result dates all
the way back to 1998.  Has this test
always failed under these circumstances,
or are we see some recent regression
exposed?

dgp added on 2006-10-13 01:21:07:
Logged In: YES 
user_id=80530


This appears to be an
8.3 -> 8.4 change (regression?)
in ~ expansion.

On a similar machine configuration
I have access to:

% info patchlevel
8.3.5
% file dirname ~
/users
% file dirname /users/dgp
/users

% info patchlevel
8.4.0
% file dirname ~
/site/users
% file dirname /users/dgp
/users

Vince can you comment?

nobody added on 2006-10-13 02:06:53:
Logged In: NO 

Hmm,

Well it's SetFsPathFromAny that does the '~ = TclGetEnv("HOME",...)', so 
something interesting must happen after that point. It's certainly not clear to me 
why there would be a difference in behaviour (particularly one that stems back 
to 8.4.0 -- I could imagine that some of the 'cleverer' code added since then 
might have caused some change here, but 8.4.0 was relatively simple from an FS 
point of view).

Vince.

dgp added on 2006-11-10 11:33:53:
Logged In: YES 
user_id=80530


ChangeLog suggests you
just fixed this?  At
least by some definition
of "fixed" ?

das added on 2006-11-10 11:40:53:
Logged In: YES 
user_id=90580

oops, didn't see this bug, yes I changed the test to compare the ~ path from the [file copy] error message to $::env
(HOME) instead of [file dirname ~]/[file tail ~].
[file dirname ~] appears to normalizes the result of ~ expansion, haven't investigated why.
feel free to revert if this wasn't the correct fix...

dgp added on 2006-11-10 23:58:05:
Logged In: YES 
user_id=80530


It's fine to correct the test
failure, but I don't think we've
got to the bottom of the
underlying 8.3->8.4 regression yet.