Skip to content
Tcl Source Code History Of Ticket 1084705
Login

History Of Ticket 1084705

Artifacts Associated With Ticket 1084705

  1. Ticket change [f918f82427] (rid 91648) by jcw on 2004-12-13 21:53:36:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.4.9"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "jcw"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "cannot make VFS driver throw error in glob"
    11. type initialized to: "Bug"
  2. Ticket change [825674919b] (rid 117220) by vincentdarley on 2004-12-14 20:58:52:

    1. 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).
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  3. Ticket change [16c9abbedb] (rid 124772) by jcw on 2004-12-14 23:06:44:

    1. 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.
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  4. Ticket change [4d64c481dc] (rid 127044) by vincentdarley on 2004-12-14 23:21:08:

    1. 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.
      
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  5. Ticket change [d02ff124e0] (rid 113124) by jcw on 2004-12-14 23:31:53:

    1. 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
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  6. Ticket change [51e1473fd9] (rid 126204) by vincentdarley on 2004-12-15 02:16:15:

    1. 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.
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. title changed to: "glob -nocomplain swallows all errors."
    5. username: "vincentdarley"
  7. Add attachment "globnoc.diff" [bbd65dbb5d] (rid 129557) by vincentdarley on 2006-03-20 02:16:52.

  8. Ticket change [224d2a3407] (rid 130722) by vincentdarley on 2006-03-20 02:16:52:

    1. foundin changed to: "obsolete: 8.5a4"
    2. 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.
      
      
      
    3. login: "vincentdarley"
    4. mimetype: "text/plain"
    5. username: "vincentdarley"
  9. Ticket change [123134ccb8] (rid 95269) by vincentdarley on 2006-03-20 02:16:53:

    1. icomment:
      
      
      File Added - 171484: globnoc.diff
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  10. Ticket change [11a1de3f6d] (rid 95180) by vincentdarley on 2006-03-20 06:07:51:

    1. closedate changed to: "2006-03-19T23:07:51"
    2. closer changed to: "vincentdarley"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"
  11. Ticket change [a4217bfcdb] (rid 110159) by dgp on 2006-03-22 21:11:13:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      any plan to backport the
      fix for 8.4.13 ?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [39ea1b4400] (rid 112472) by vincentdarley on 2006-03-23 16:56:56:

    1. 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.
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  13. Ticket change [a70d89b6c4] (rid 98717) by dkf on 2006-03-23 17:20:18:

    1. 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 ).
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  14. Ticket change [8bb8eca32e] (rid 127619) by jcw on 2006-03-23 18:36:31:

    1. 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.
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"