Artifacts Associated With Ticket 1084705
Ticket change [f918f82427] (rid 91648) by jcw on 2004-12-13 21:53:36:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
(This may be a TclVFS issue, but I'm not sure) Am writing a VFS driver in Tcl, which needs to throw errors (EACCESS) for certain calls to "glob" from Tcl. The "matchindirectory" handles glob, but I cannot make it generate errors which get thrown back to the caller of glob. A TclVFS driver with the following definition in it returns an empty list for glob, instead of throwing an error: proc matchindirectory {conn path actualpath pattern type} { error bah! } A related detail perhaps is mentioned on the wiki at the end of page http://mini.net/tcl/12328 - it does not apply to matchindirectory, which according to the docs does not use posixerror, but I'll include it for completeness: % vfs::filesystem posixerror 13 command returned bad code: -1 % My test environment was a couple of different 8.4.9 and 8.5a2 builds on Mac OS X (tclsh's, wish's, and tclkit's). None return an error from glob. -jcw - foundin initialized to: "obsolete: 8.4.9"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "jcw"
- subsystem initialized to: "37. File System"
- title initialized to: "cannot make VFS driver throw error in glob"
- type initialized to: "Bug"
Ticket change [825674919b] (rid 117220) by vincentdarley on 2004-12-14 20:58:52:
- icomment:
Logged In: YES user_id=32170 Can you please attach the vfs driver and instructions for reproducing the bug (i.e. a test case of some kind).
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [16c9abbedb] (rid 124772) by jcw on 2004-12-14 23:06:44:
- icomment:
Logged In: YES user_id=1983 Attached a test file errvfs.tcl, which is testvfs.tcl but edited to always throw an error in matchindirectory. Here's the output from this script: OK: { glob D* } result {Desktop Documents} OK: { glob -nocomplain D* } result {Desktop Documents} ERROR: { glob blah* } -> code 1 msg {no files matched glob pattern "blah*"} OK: { glob -nocomplain blah* } result {} ERROR: { glob root/blah* } -> code 1 msg BOOM! OK: { glob -nocomplain root/blah* } result {} The last case explains the problem I ran into: -nocomplain loses all errors, not just from returning no match. - login: "jcw"
- mimetype: "text/plain"
- username: "jcw"
- icomment:
Ticket change [4d64c481dc] (rid 127044) by vincentdarley on 2004-12-14 23:21:08:
- icomment:
Logged In: YES user_id=32170 It would've been helpful if you had mentioned that -nocomplain was used in the original report! Tcl's glob has always discarded all errors when using '-nocomplain'. Hence you are asking for a changed behaviour in Tcl. I think the reason for this behaviour is probably that glob takes multiple pattern arguments: glob -nocomplain a* b* ~asdasd is supposed to concatenate the lists for each pattern in turn. Hence -nocomplain's behaviour of ignoring all errors (else an error in one pattern would mess up a different one). I don't necessarily agree that this is good, but Tcl has always done this. In fact I'd be keen to change this behaviour, but am not sure it is possible without a TIP. Vince.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [d02ff124e0] (rid 113124) by jcw on 2004-12-14 23:31:53:
- icomment:
Logged In: YES user_id=1983 It would have, indeed. I apologize for not detecting the difference (I always use -nocomplain). Do we really need a TIP? The docs do not mention eating errors in glob: http://www.tcl.tk/man/tcl8.4/TclCmd/glob.htm#M7 I can of course set a global flag in the driver, and check it at the call site, but the current behavior sure took me by surprise. -jcw
- login: "jcw"
- mimetype: "text/plain"
- username: "jcw"
- icomment:
Ticket change [51e1473fd9] (rid 126204) by vincentdarley on 2004-12-15 02:16:15:
- icomment:
Logged In: YES user_id=32170 Updated summary line. You're probably right that this doesn't need a TIP -- I also think part of the historical motivation for it was that the code used to be structured so this was very difficult to achieve. That's no longer true, I think.
- login: "vincentdarley"
- mimetype: "text/plain"
- title changed to: "glob -nocomplain swallows all errors."
- username: "vincentdarley"
- icomment:
Add attachment "globnoc.diff" [bbd65dbb5d] (rid 129557) by vincentdarley on 2006-03-20 02:16:52.
Ticket change [224d2a3407] (rid 130722) by vincentdarley on 2006-03-20 02:16:52:
- foundin changed to: "obsolete: 8.5a4"
- icomment:
Logged In: YES user_id=32170 Attached is a patch to implement this - given the newer 'glob' code this is actually a decent simplification. We should clarify the documentation, of course.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [123134ccb8] (rid 95269) by vincentdarley on 2006-03-20 02:16:53:
- icomment:
File Added - 171484: globnoc.diff
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [11a1de3f6d] (rid 95180) by vincentdarley on 2006-03-20 06:07:51:
- closedate changed to: "2006-03-19T23:07:51"
- closer changed to: "vincentdarley"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [a4217bfcdb] (rid 110159) by dgp on 2006-03-22 21:11:13:
- icomment:
Logged In: YES user_id=80530 any plan to backport the fix for 8.4.13 ?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [39ea1b4400] (rid 112472) by vincentdarley on 2006-03-23 16:56:56:
- icomment:
Logged In: YES user_id=32170 The code cleanup that I think dkf applied to tclFileName.c a couple of years ago would need applying to 8.4 before these changes could be used in 8.4. So I don't have any current plans to do that.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [a70d89b6c4] (rid 98717) by dkf on 2006-03-23 17:20:18:
- icomment:
Logged In: YES user_id=79902 IIRC, the code I cleaned out was something of a cesspit, in that it was complicated and very hard to analyse for correctness. Given that, backporting is a real chore (and I can't be bothered :-p ).
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [8bb8eca32e] (rid 127619) by jcw on 2006-03-23 18:36:31:
- icomment:
Logged In: YES user_id=1983 To what extent are 8.4 and 8.5 branches different w.r.t. VFS? And perhaps 2nd Q: why? I know there are init/encoding differences, but apart from that I've been able to keep 8.4/8.5 builds of Tclkit pretty much the same. And while we're at it: how about making the VFS subsystem more loosely coupled? If the native fs were optional, one could create a secure sandbox (by having only support for an end-of-exe VFS with runtime & starpack files). And more to the point: more code might be shareable between 8.4 and 8.5.
- login: "jcw"
- mimetype: "text/plain"
- username: "jcw"
- icomment: