Artifacts Associated With Ticket 833713ffff
Ticket change [3692e21822] (rid 107125) by hemanglavana on 2003-10-31 15:34:03:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When I create symbolic links (on solaris and linux, tcl8.4.4) using [file link -symbolic ...] command, the created link file always points to an absolute path even when a relative path is specified. This is causing problems when the directory is moved around and the links have to be deleted and re-created. Is this the correct behavior (dictated by cross-platform support)? It would be nice if the [file link] command behaved like the unix 'ln' utility in this respect so that I don't have to invoke [exec ln -s ...] for creating relative links. Hemang. ----------------------------- I don't see that this is specifically mentioned anywhere in the docs of the implementation. It seems a byproduct of the Tcl_FSGetNativePath request returning a fully qualified path. I'm not sure whether this is a bug, so I've cc'ed the implementor, Vince Darley. Jeff Hobbs
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "hemanglavana"
- subsystem initialized to: "37. File System"
- title initialized to:
Creating relative links with "file link .." command?
- type initialized to: "Bug"
Ticket change [90d54afe09] (rid 120520) by vincentdarley on 2003-10-31 22:42:54:
- icomment:
Logged In: YES user_id=32170 It's hard to say if this is a bug or a feature. On balance (for Unix) I suppose it is a bug. The solution is to modify TclpObjLink's creation of 'target': CONST char *target = Tcl_FSGetNativePath(toPtr); so that it just uses 'Tcl_GetString' and a manual Tcl_UtfToExternal conversion. I don't know if Windows/MacOS support such relative links or not.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [6ae7cd2b63] (rid 128229) by dgp on 2003-11-13 08:05:55:
- foundin changed to: "obsolete: 8.4.4"
Ticket change [0327ecc97f] (rid 119774) by vincentdarley on 2003-12-11 17:59:15:
- icomment:
Logged In: YES user_id=32170 I'll set about fixing this, but first a question. Is a symbolic link on Unix effectively just a link to an arbitrary 'string' or is some pre-processing done first? For example, what should: % file link -symbolic foo ~vince do? Should it genuinely link to '~vince' or should it first expand '~vince' and link to the expanded version?
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [a6c92eea8e] (rid 98665) by vincentdarley on 2003-12-11 18:29:32:
- icomment:
Logged In: YES user_id=32170 Please try the attached patch.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [43d7f87e9b] (rid 116624) by vincentdarley on 2003-12-11 18:29:33:
- icomment:
File Added - 70240: unixlink.diff
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [19aa99bc1e] (rid 122832) by hemanglavana on 2003-12-12 00:49:02:
- icomment:
Logged In: YES user_id=81875 On unix systems, "~/foo" is first expanded by the shell before passing it onto the link command. So such files will have absolute paths, see below: godel:271> ln -s ~/foo bar godel:272> ls -l bar lrwxrwxrwx 1 hlavana eng 18 Dec 11 10:20 bar -> /users/hlavana/foo godel:273> I have verified that your patch work correctly for relative links. As for the ~ chars, it should expand into absolute paths, otherwise on unix the link is not created properly: hlavana-u5:165> ./tcltk/bin/tclsh8.4 % file link -symbolic foo ~/ddts ~/ddts % cat foo cat: cannot open foo child process exited abnormally % file exists foo 0 % file exists ~/ddts 1 % exit hlavana-u5:166> ls -l foo lrwxrwxrwx 1 hlavana eng8 6 Dec 11 12:41 foo -> ~/ddts hlavana-u5:167> cat foo cat: cannot open foo hlavana-u5:168> As you can see, ~/ddts is a valid file but foo not exist.
- login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"
- icomment:
Ticket change [31e4fb6c84] (rid 93515) by vincentdarley on 2003-12-12 16:52:31:
- icomment:
File Added - 70333: linknorm.diff Logged In: YES user_id=32170 Could you try this updated patch? -- it fixes the ~user issue and also patches some generic normalization code so that it can handle these relative links. It would be very helpful if you could run the file*.test tests after applying this patch.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [19ba77ce1e] (rid 122841) by hemanglavana on 2003-12-13 00:05:07:
- icomment:
Logged In: YES user_id=81875 I am seeing some failures on solaris2.8 with your patch applied to cvs head: fCmd.test ==== fCmd-9.14.2 file rename: comprehensive: dir into self FAILED ==== Contents of test case: cleanup file mkdir td1 set dir [pwd] cd td1 set res [list [catch {file rename [file join .. td1] [file join .. td1x]} ms g] $msg] cd $dir set res ---- Result was: 0 {} ---- Result should have been (exact matching): 1 {error renaming "../td1" to "../td1x": permission denied} ==== fCmd-9.14.2 FAILED fileSystem.test ==== filesystem-1.7 link normalisation FAILED ==== Contents of test case: string equal [file normalize [file join dir.link linkinside.file foo]] [file normalize [file join dir.file inside.file foo]] ---- Result was: 0 ---- Result should have been (exact matching): 1 ==== filesystem-1.7 FAILED ==== filesystem-1.9 link normalisation FAILED ==== Contents of test case: file delete -force dir.link file link dir.link [file nativename dir.file] string equal [file normalize [file join dir.file linkinside.file foo]] [fil e normalize [file join dir.link inside.file foo]] ---- Result was: 0 ---- Result should have been (exact matching): 1 ==== filesystem-1.9 FAILED ==== filesystem-1.10 link normalisation: double link FAILED ==== Contents of test case: file link dir2.link dir.link string equal [file normalize [file join dir.file linkinside.file foo]] [fil e normalize [file join dir2.link inside.file foo]] ---- Result was: 0 ---- Result should have been (exact matching): 1 ==== filesystem-1.10 FAILED ==== filesystem-1.11 link normalisation: double link, back in tree FAILED ==== Contents of test case: file link [file join dir2.file dir2.link] dir2.link string equal [file normalize [file join dir.file linkinside.file foo]] [fil e normalize [file join dir2.file dir2.link inside.file foo]] ---- Result was: 0 ---- Result should have been (exact matching): 1 ==== filesystem-1.11 FAILED - login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"
- icomment:
Add attachment "linknorm.diff" [e9630d00ae] (rid 104813) by vincentdarley on 2003-12-13 00:17:41.
Ticket change [6c2b0d3c4b] (rid 128453) by vincentdarley on 2003-12-13 00:17:41:
- icomment:
File Deleted - 70333: File Added - 70362: linknorm.diff Logged In: YES user_id=32170 Hmm -- I'll have to think about those. I've updated fileSystem.test to be more informative. Could you please re-run the tests with those changes in place? (either (a) just update fileSystem.test from cvs and re-run, or (b) update everything from cvs then apply the patch attached to this report and re-run).
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [6f109cdc81] (rid 100247) by hemanglavana on 2003-12-13 01:36:59:
- icomment:
Logged In: YES user_id=81875 Okay, I tried option (b) and now I get only one error: fCmd.test ==== fCmd-9.14.2 file rename: comprehensive: dir into self FAILED ==== Contents of test case: cleanup file mkdir td1 set dir [pwd] cd td1 set res [list [catch {file rename [file join .. td1] [file join .. td1x]} ms g] $msg] cd $dir set res ---- Result was: 0 {} ---- Result should have been (exact matching): 1 {error renaming "../td1" to "../td1x": permission denied} ==== fCmd-9.14.2 FAILED - login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"
- icomment:
Ticket change [68f3fab64f] (rid 103154) by dgp on 2003-12-13 06:28:24:
- icomment:
Logged In: YES user_id=80530 See Tcl Bug 747629.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f3a3867a20] (rid 129748) by vincentdarley on 2003-12-16 17:37:53:
- icomment:
Logged In: YES user_id=32170 Can you tell me what 'file norm [file join .. td1]' and 'file norm [file join .. td1x]' give at this point in the test suite? Do they appear to be correct? What is '$dir' in this test? thanks!
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [6be4fee565] (rid 128403) by hemanglavana on 2003-12-16 22:08:35:
- icomment:
Logged In: YES user_id=81875 This is on solaris 2.8. godel:144> /tmp/hlavana/tcltk/bin/tclsh8.5 % info patch 8.5a0 % file mkdir td1 % set dir [pwd] /tmp/hlavana % cd td1 % set f1 [file normalize [file join .. td1]] /tmp/hlavana/td1 % set f2 [file normalize [file join .. td2]] /tmp/hlavana/td2 % file join .. td1 ../td1 % file join .. td2 ../td2 % file rename [file join .. td1] [file join .. td2] % pwd /tmp/hlavana/td2 % file rename [file join .. td2] [file join .. td3] % pwd /tmp/hlavana/td3 % It seems that it is possible to change the name of the current directory on solaris platforms.
- login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"
- icomment:
Ticket change [53140871b7] (rid 126420) by vincentdarley on 2003-12-16 22:26:30:
- closedate changed to: "2003-12-16T15:26:30"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 Thanks -- all appears fine, as you say. I'll mark that test as nonPortable and close this.
- login: "vincentdarley"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"
Ticket change [819f94fd06] (rid 117070) by hobbs on 2004-02-07 01:10:32:
- icomment:
Logged In: YES user_id=72656 Reopening for 8.4.6 backport.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "8"
- status changed to: "Open"
- username: "hobbs"
- icomment:
Ticket change [24f4f548bd] (rid 131200) by dgp on 2004-12-16 05:21:43:
- title changed to: "Creating relative links with "file link .." comman"
Ticket change [85f4d87513] (rid 131418) by dgp on 2004-12-16 05:21:44:
- icomment:
Logged In: YES user_id=80530 this was never backported?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [ac033dd846] (rid 101220) by matzek on 2005-07-29 19:52:14:
- icomment:
Logged In: YES user_id=330806 Are there any plans to backport this into 8.4? I would really need it there! -- Matthias Kraft
- login: "matzek"
- mimetype: "text/plain"
- username: "matzek"
- icomment:
Ticket change [6fb31dd55b] (rid 100357) by dgp on 2006-03-10 10:59:56:
- icomment:
Logged In: YES user_id=80530 Getting this backported for 8.4.13 would be really nice. I realize it's a tall order...
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dgp"
- icomment:
Ticket change [94ce721a05] (rid 106059) by dgp on 2006-03-31 23:19:00:
- priority changed to: "7 High"