Artifacts Associated With Ticket 511666ffffffffff
Ticket change [da2680b60f] (rid 107726) by vincentdarley on 2002-02-01 12:29:51:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Various emails discussing this bug quoted below: Hi Vince, (iii) sounds workable with modest "surprise" added to the design. In this case the special handling seems appropriate. I say this still w/o seeing the code. A patch would be great because I think (i) is just plain goofy. - Thanks. Roy > I've looked into this further and I see three options: > > (i) ignore the bug and define 'glob' to behave in this way when the user > gives a fully-specified file name (i.e. when there's no pattern matching). > > (ii) add a new filesystem-specific API (i.e. yet another Tcl_FS... function > which must be implemented for each filesystem) which matches file-types > according to 'Tcl_GlobTypeData'. This function could be used to simplify > each 'TclpMatchInDirectory' implementation, perhaps, (loop over each file > which matches the glob pattern and pass that file to the new API), although > there might be a performance penalty to pay. > > (iii) change the way TclpMatchInDirectory works so that it can handle the > special case we need here. This can be done in a backwards compatible way > as follows: if 'pattern' is NULL then consider the 'pathPtr' which is > passed in not as a directory in which to search, but as a fully-specified > path to check against 'types'. This is backwards compatible because the > code will currently segfault if pattern is NULL (but pattern is currently > never NULL, of course). > > I would lean towards (iii) as the best solution, since (ii) is needlessly > complicated and (i) isn't very good. However, if we do adopt (iii) we might > then wish to change the name of the function too (it's a new function in > Tcl 8.4a3 so changing it isn't a compatibility issue). > > Any thoughts? > > Vince. > > Note: my original suggestion of duplicating code in tclFileName.c is no > good, because that code is filesystem/platform specific (because matching > against 'Tcl_GlobTypeData' is platform specific). > > At 09:51 AM 1/22/2002 -0800, Roy Terry wrote: > >Vince, > >I take your word for it. I wasn't able to find it in > >my source which which I believe is 8.4a3 and where > >RCS: @(#) $Id: tclFileName.c,v 1.16 2001/08/07 01:00:02 hobbs Exp $ > >only has 2360 lines. I must be behind a bit. For my 2 cents, > >I'd be a bit concerned about duplicating though certainly the essential > >properties of files seem pretty stable. I will be refreshing my > >code in the next few weeks so if you've not put in a fix by then > >I'll get back in touch and see If I can contribute. > > > > > >Thanks, > >Roy > > > > > Found a few minutes to look more closely at the code. Basic problem which > > > needs fixing starts in the block of code at line 2477 of > > > tclFileName.c. This code doesn't pay any attention to the 'types' argument > > > of the function (TclDoGlob). While there may be elegant ways of fixing the > > > code without duplication (as alluded to below), if one adds suitable > > > 'types' checking to that block of code, it'll fix this problem. > > > > > > cheers, > > > > > > Vince. > > > > > > At 04:22 PM 1/21/2002 -0800, Jeff Hobbs wrote: > > > >Roy Terry wrote: > > > > > > > > > > In the following transcript, notice how the > > > > > -types restriction seems to be ignored if > > > > > a literal file name is given. > > > > > > > >Yes, that does seem to be the case, tested on the head and 8.3.4. > > > >Evidently the -types check isn't being heeded when there is just > > > >one file matching, or something like that. > > > > > > > > > (tmp) 84 % ls -l > > > > > ./: > > > > > -r--r--r-- 316 Jan 18 12:56 x > > > > > (tmp) 85 % glob -types f ? > > > > > x > > > > > (tmp) 86 % glob -types f . > > > > > . > > > > > (tmp) 87 % glob -types w ? > > > > > no files matched glob pattern "?" > > > > > (tmp) 88 % glob -types w x > > > > > x > > > > > (tmp) 89 % puts $tcl_patchLevel > > > > > 8.4a4 > > > > > (tmp) 90 % parray tcl_platform > > > > > tcl_platform(byteOrder) = littleEndian > > > > > tcl_platform(machine) = intel > > > > > tcl_platform(os) = Windows NT > > > > > tcl_platform(osVersion) = 4.0 > > > > > tcl_platform(platform) = windows > > > > > tcl_platform(user) = roy > > > > > (tmp) 91 % > > > >
- foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "vincentdarley"
- subsystem initialized to: "37. File System"
- title initialized to: "glob with full path ignores -types"
- type initialized to: "Bug"
Ticket change [d5d70a065f] (rid 123702) by vincentdarley on 2002-02-01 20:18:28:
- icomment:
File Added - 17108: globFix.patch Logged In: YES user_id=32170 Here's a suggested fix for this bug (including tests) which works for me on Windows. The code will fail completely on Unix/MacOS. I'm not going to have time for a while to complete the patch for those OSes, so please help out!
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [7ded5c22ff] (rid 97313) by vincentdarley on 2002-02-05 02:08:01:
- icomment:
Logged In: YES user_id=32170 Added patch with unix implementation (done blind -- needs testing for compilation and against fileName.test).
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [fce30048c5] (rid 108311) by vincentdarley on 2002-02-05 02:08:03:
- icomment:
File Added - 17257: globFix.patch
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [4cbe9bbc58] (rid 126943) by andreas_kupries on 2002-02-05 07:10:46:
- icomment:
Logged In: YES user_id=75003 Applies cleanly. Compiles cleanly. Starting the testsuite crashes the core immediately, in NativeMatchType, line 372. argument "types" is NULL. Going through the call chain shows that the variable "globTypes" in Tcl_GlobObjCmd (tclFileName.c, 1542) is NULL. There has to be a branch not initializing it.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [25825afe5f] (rid 88184) by andreas_kupries on 2002-02-05 07:13:02:
- icomment:
Logged In: YES user_id=75003 Initialization is done only if "typePtr" is not NULL, and typePtr seems to come from the command arguments.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [b3f9edae02] (rid 124940) by vincentdarley on 2002-02-05 17:09:00:
- icomment:
Logged In: YES user_id=32170 Attached a fix for andreas's issue. NativeMatchType should begin: if (types == NULL) { /* * Simply check for the file's existence, but do it * with lstat, in case it is a link to a file which * doesn't exist (since that case would not show up * if we used 'access' or 'stat') */ if (lstat(nativeEntry, &buf) != 0) { return 0; } } else { ...indented rest of code ... } return 1 - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [8a48e0b79a] (rid 127366) by vincentdarley on 2002-02-05 17:09:02:
- icomment:
File Added - 17294: globFix.patch
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [df9307f2a5] (rid 115033) by vincentdarley on 2002-02-05 22:45:10:
- icomment:
Logged In: YES user_id=32170 Attached patch which includes an attempt at a version for MacOS too. This is about all I can do. People on unix/macos will have to test and fix from here.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [c4c837bc13] (rid 111893) by vincentdarley on 2002-02-05 22:45:15:
- icomment:
File Added - 17303: globFix.patch
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [223c190a82] (rid 130708) by vincentdarley on 2002-02-05 22:58:48:
- assignee changed to: "das"
Ticket change [3e6e103e98] (rid 121266) by vincentdarley on 2002-02-05 22:58:49:
- icomment:
Logged In: YES user_id=32170 Re-assigning bug since I've done about all I can on it.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [7beb47860f] (rid 96987) by vincentdarley on 2002-02-11 19:40:19:
- icomment:
File Added - 17640: globFix.patch Logged In: YES user_id=32170 recent cvs commits conflicted with this patch, so uploading a new one which will apply to cvs head.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [e7d81c6b39] (rid 104537) by vincentdarley on 2002-02-18 20:00:09:
- icomment:
Logged In: YES user_id=32170 Added yet another new patch, since the TIP#72 commits mess with the patch!
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [6e049727ae] (rid 128805) by vincentdarley on 2002-02-18 20:00:30:
- icomment:
File Added - 18047: globFix.patch
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [61c33723a2] (rid 92303) by vincentdarley on 2002-02-22 01:57:14:
- assignee changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=32170 Andreas: would you mind taking another look at this; I think it should now work better than before.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [c042c73178] (rid 102375) by vincentdarley on 2002-02-22 01:57:15:
- icomment:
File Deleted - 17108:
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [290e67d811] (rid 88808) by andreas_kupries on 2002-02-26 11:36:01:
- assignee changed to: "vincentdarley"
Ticket change [e4edcddbc4] (rid 88036) by andreas_kupries on 2002-02-26 11:36:02:
- icomment:
Logged In: YES user_id=75003 The patch as it is here * Applies cleanly. * Compiles cleanly. * Passes testsuite. (Linux/Intel gcc 2.95.2, against 8.4cvs as of Feb 25, 7pm) Did not not teat the Mac part.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [d4f55b100d] (rid 123534) by vincentdarley on 2002-02-26 21:31:48:
- assignee changed to: "das"
Ticket change [7a6b5644be] (rid 90314) by vincentdarley on 2002-02-26 21:31:49:
- icomment:
Logged In: YES user_id=32170 Daniel: it works on Windoze and Unix. Would you mind testing on MacOS? --- it will require a (small?) amount of work in tclMacFile.c, to get compiled and running, but I've made the basic changes required.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [2e8411d6b3] (rid 119238) by vincentdarley on 2002-03-14 23:43:08:
- icomment:
Logged In: YES user_id=32170 Quick thought: once Daniel has fixed the MacOS side of things, should we rename 'Tcl_FSMatchInDirectory' to 'Tcl_FSMatchPathTypes' because the function might now either search all files in the given directory for ones with the right type, OR check a single file for having the right type. The old name isn't very logical given the new behaviour, is it? This would only be a change since 8.4a3/a4 and wouldn't impact any external code except 'tclvfs' which I maintain anyway (and which needs updating as a result of this patch anyway).
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [2e8f87a3b6] (rid 119243) by vincentdarley on 2002-03-17 00:29:19:
- icomment:
File Deleted - 18047: Logged In: YES user_id=32170 Uploading a newer patch which fixes some other reported bugs, and makes file normalize work as advertised on unix. The question still remains whether we should rename 'Tcl_FSMatchInDirectory' and the Mac implementation is still needed.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [ad870d5031] (rid 101483) by vincentdarley on 2002-03-17 00:30:48:
- icomment:
File Added - 19480: fileSystem.test Logged In: YES user_id=32170 source forge playing up, try again...
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Add attachment "fileSystem.test" [b9e9ea7be1] (rid 129228) by vincentdarley on 2002-03-17 00:30:48.
Ticket change [fa9469af31] (rid 91898) by vincentdarley on 2002-03-17 00:32:24:
- icomment:
File Added - 19481: globLinkFix.patch Logged In: YES user_id=32170 upload patch.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Add attachment "globLinkFix.patch" [3e37dda75a] (rid 121224) by vincentdarley on 2002-03-17 00:32:24.
Add attachment "glob18.patch" [6309d29372] (rid 92507) by vincentdarley on 2002-03-18 17:42:14.
Ticket change [3a55d994be] (rid 112547) by vincentdarley on 2002-03-18 17:42:14:
- icomment:
File Added - 19556: glob18.patch
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [d94fa5210a] (rid 107588) by vincentdarley on 2002-03-24 19:29:50:
- closedate changed to: "2002-03-24T12:29:50"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 committed patch with mac support added.
- login: "vincentdarley"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"
Ticket change [3c84a848b8] (rid 120927) by das on 2002-04-08 16:03:14:
- closedate changed to: "2002-04-08T09:03:14"
- closer changed to: "das"
- icomment:
Logged In: YES user_id=90580 checked into the HEAD: 2002-04-08 Daniel Steffen <[email protected]> * mac/tclMacFile.c: minor fixes to Vince's changes from 03-24. * tests/fileSystem.test: with these changes all tests pass and everything works as it should; except for [file normalize] behaviour w.r.t to alias files, i.e. on the mac, the file commands currently resolve the last path component if it is an alias file, so e.g. there is no way to delete an alias file, the original will be deleted instead...
- login: "das"
- mimetype: "text/plain"
- username: "das"
Ticket change [049dc3ffde] (rid 120033) by nobody on 2002-04-08 18:10:05:
- icomment:
Logged In: NO Thanks for fixing the glitches on MacOS! A quick note re. 'normalization and aliases': The MacOS behaviour (expand all links including final ones) is what I originally planned and thought was correct. However, 'file copy' 'file delete' etc are all /defined/ in the man pages to operate on links in preference to real files. If the results of the normalizePathProcs resolve the final alias/link in the chain, then the behaviour of file delete/copy etc is wrong. I'm was wondering whether the Tcl-level command 'file normalize' should perform additional checking to resolve the final alias in the chain. In the end I decided it shouldn't.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [a7bac5e7ea] (rid 98859) by das on 2002-04-08 19:29:59:
- closedate changed to: "2002-04-08T12:29:59"
- closer changed to: "das"
- icomment:
Logged In: YES user_id=90580 ok, so this means modifing tcl/mac/tclMacFCmd.c (TclpObjNormalizePath) to no longer resolve the last path component should take care of all the [file *] problems, correct?
- login: "das"
- mimetype: "text/plain"
- username: "das"
Ticket change [db6f5f538e] (rid 107962) by nobody on 2002-04-08 21:33:31:
- icomment:
Logged In: NO Yes, it should -- Vince.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Add attachment "tcl-mac-aliases.patch" [95d6917047] (rid 106219) by das on 2002-04-19 21:17:25.
Ticket change [0c40e3d3d5] (rid 114142) by das on 2002-04-19 21:17:25:
- closedate changed to: "2002-04-19T14:17:25"
- closer changed to: "das"
- icomment:
Logged In: YES user_id=90580 attached and checked a patch that fixes alias file handling on the mac as discussed. In addition to changing TclpObjNormalizePath it was necessary to introduce a new alias aware version of FSpLocationFromPath (FSpLLocationFromPath). 2002-04-20 Daniel Steffen <[email protected]> * generic/tclInt.decls: * generic/tclIntPlatDecls.h: * generic/tclStubInit.c: * mac/tclMacFCmd.c: * mac/tclMacFile.c: * mac/tclMacUtil.c: Modified TclpObjNormalizePath to be alias file aware, and replaced various calls to FSpLocationFrom*Path by calls to new alias file aware versions FSpLLocationFrom*Path. The alias file aware routines don't resolve the last component of a path if it is an alias. This allows [file copy/delete] etc. to act correctly on alias files. (c.f. discussion in Bug #511666)
- login: "das"
- mimetype: "text/plain"
- username: "das"
Ticket change [9d7e4c64ac] (rid 96316) by das on 2002-04-19 21:17:26:
- icomment:
File Added - 21520: tcl-mac-aliases.patch
- login: "das"
- mimetype: "text/plain"
- username: "das"
- icomment: