Artifacts Associated With Ticket 504950ffffffffffffffffffffffffffffffffff
Ticket change [96cd11245e] (rid 106387) by dgp on 2002-01-17 17:01:24:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The new Tcl_FSGetTranslatedStringPath appears to be the VFS-aware counterpart of Tcl_TranslateFileName. However, they differ in their translation of file names on non-Unix platforms. On Windows, Tcl_TranslateFileName converts all '/' separators to '\'. The new routine does not. On Mac, Tcl_TranslateFileName and the new routine differ on how they manage runs of ':'. In particular, if I rewrite Tcl_TranslateFileName as a wrapper around Tcl_FSGetTranslatedStringPath, then the following tests fail: cmdAH-19.7 filename-10.2 filename-10.3 filename-10.13 filename-10.15 filename-10.16 filename-10.17 filename-10.18 filename-10.21 filename-10.22
- foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "37. File System"
- title initialized to: "filename translation inconsistent"
- type initialized to: "Bug"
Ticket change [966830794b] (rid 106319) by dgp on 2002-01-19 01:41:16:
- icomment:
Logged In: YES user_id=80530 Hmmm.... Tcl_FSGetNativePath might be what I want instead.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [264dc677cf] (rid 88321) by dgp on 2002-01-19 01:53:42:
- icomment:
Logged In: YES user_id=80530 Nope. Tcl_FSGetNativePath is much worse.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [73046c5205] (rid 104972) by nobody on 2002-01-22 00:33:29:
- icomment:
Logged In: NO Tcl_FSGetTranslatedStringPath is designed _not_ to convert backslashes, (unlike the older string based API), so those tests will need changing if they now claim to test the new routine (this is documented in the source code, but perhaps not in the docs). Could you please list the actual bad test results instead of just the numbers (else, I will have time in a couple of weeks to look at this properly). More generally, 'Tcl_FSGetNormalizedPath' is the ideal thing to use under most circumstances (but, note, it returns an absolute path). -- Vince.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [55fdc059df] (rid 94244) by dgp on 2002-01-22 01:31:49:
- icomment:
Logged In: YES user_id=80530 Let me ask it this way then. The command [file nativename] is implemented in lines 1016-1032 of tclCmdAH.c as: 1016 case FILE_NATIVENAME: { 1017 char *fileName; 1018 Tcl_DString ds; 1019 1020 if (objc != 3) { 1021 goto only3Args; 1022 } 1023 fileName = Tcl_GetString(objv[2]); 1024 fileName = Tcl_TranslateFileName(interp, fileName, &ds); 1025 if (fileName == NULL) { 1026 return TCL_ERROR; 1027 } 1028 Tcl_SetStringObj(Tcl_GetObjResult(interp), fileName, 1029 Tcl_DStringLength(&ds)); 1030 Tcl_DStringFree(&ds); 1031 return TCL_OK; 1032 } If I want to re-implement so that Tcl_TranslateFileName() is not called, but some of the new VFS-aware routines are called instead, what should I call to get the same results? - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [63d5cfc709] (rid 92648) by vincentdarley on 2002-01-22 17:40:59:
- icomment:
Logged In: YES user_id=32170 My recommendation would be to implement those lines as 'Tcl_FSGetTranslatedPathString', followed by (on Windows) a manual translation of forward slashes to backslashes to yield the desired 'native path name'. The rest of the Tcl core's C code doesn't really care about the result of the Tcl-level command 'file nativename' (the core uses the caching Tcl_FSGetNativePath), so I think it's ok to do things like this. An alternative (more complex) would be to add a new Tcl_FS command which returns the relative part of the normalized native path, but that's quite a complex operation. Daniel Steffen may need to look at how the code handles runs of ':' if there are problems there. Hope that helps; sorry not to be more actively helpful right now.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [44e5ee1fad] (rid 116788) by dgp on 2002-01-23 01:49:37:
- icomment:
Logged In: YES user_id=80530 OK, that will take care of me on Windows and Unix. After looking over filename.n, it appears to me that Tcl_FsGetTranslatedPathString may be buggy in its interpretation of multiple ':' on Mac. '::' mean parent directory, ':::' means parent of parent, etc., but it's not clear that meaning is being preserved. More details after I look it over.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e15d7ff77d] (rid 87433) by dgp on 2002-01-23 20:39:06:
- icomment:
Logged In: YES user_id=80530 Here's a specific bug related to the trouble seen on Macs. The tilde-expansion in SetFsPathFromAny is flawed in the way it handle separators right after the expanded tilde. This is most easily seen by the way it converts the string ~//foo to the path /foo.
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "filename translation inconsistent"
- username: "dgp"
- icomment:
Ticket change [f9b0d3e223] (rid 91742) by dgp on 2002-01-23 20:42:11:
- icomment:
Logged In: YES user_id=80530 Here's a specific bug related to the trouble seen on Macs. The tilde-expansion in SetFsPathFromAny is flawed in the way it handle separators right after the expanded tilde. This is most easily seen by the way it converts the string ~//foo to the path /foo.
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "SetFsPathFromAny: ~//foo -> /foo"
- username: "dgp"
- icomment:
Ticket change [74439469a6] (rid 105178) by dgp on 2002-01-23 20:45:34:
- icomment:
Logged In: YES user_id=80530 Here's a specific bug related to the trouble seen on Macs. The tilde-expansion in SetFsPathFromAny is flawed in the way it handle separators right after the expanded tilde. This is most easily seen by the way it converts the string ~//foo to the path /foo.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d93e10b05c] (rid 107577) by vincentdarley on 2002-01-23 21:40:18:
- icomment:
Logged In: YES user_id=32170 What should the correct result of '~//foo' be? Is it defined to be the same as '~/foo'? What about on MacOS? What are ~::foo and ~:::foo? Vince.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Add attachment "tilde.patch" [b63935c70d] (rid 125382) by dgp on 2002-01-24 01:39:55.
Ticket change [6c29f1c3e7] (rid 128452) by dgp on 2002-01-24 01:39:55:
- icomment:
Logged In: YES user_id=80530 Yes, and see tests filename-10.{13,15,16}. Here's a patch that fixes the problem. Please review that it fits in with the VFS system design. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a989545f8c] (rid 99163) by dgp on 2002-01-24 01:40:09:
- icomment:
File Added - 16643: tilde.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d5642b1136] (rid 123615) by dgp on 2002-01-25 11:27:34:
- assignee changed to: "dgp"
- closedate changed to: "2002-01-25T04:27:34"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 committing fix to HEAD (8.4a4). If you find problems with it, Vince, we can back it out.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"
Ticket change [7c0045d5c4] (rid 97003) by nobody on 2002-01-25 18:11:34:
- icomment:
Logged In: NO This looks fine. A more efficient solution _might_ be possible (I haven't looked closely enough to be absolutely sure), by simply skipping any extra separators and then using the existing 'JoinToPath' stuff. Anyway, the existing solution looks good. -- Vince.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [e84cd8b633] (rid 104623) by dgp on 2002-01-25 20:43:38:
- closedate changed to: "2002-01-25T13:43:38"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 That approach would be correct and more efficient on unix-style paths, but would be completely wrong for the mac-style paths. It seemed somehow "cleaner" to use existing TclpNative* routines to cover the platform differences rather than add more platform-specific processing directly in SetFsPathFromAny itself. That said, I certainly have no objection if later on you replace this correct implementation with a different correct implementation that's also more efficient.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"