bugMIT/GNU Scheme - Bugs: bug #30546, Documentation for directory-read...

 
 

bug #30546: Documentation for directory-read disagrees with behaviour

Submitter:  None
Submitted:  Sun 25 Jul 2010 05:14:06 PM UTC
   
 
Category:  runtime Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  Taylor Venable
Originator Email:  -email is unavailable- Open/Closed:  Closed
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 11 May 2012 03:53:00 PM UTC, comment #2: 

Commit 49db7bb seems to fix this, except for OS2(?).

Matt Birkholz <mhb>
Group Member
Mon 26 Jul 2010 04:26:06 AM UTC, comment #1: 

I don't know what the intended behaviour is, since I didn't write the code, but personally I don't use DIRECTORY-READ except with directory pathnames, for which case its semantics is clear, on all operating systems.  Someone else will have to weigh in on the intended behaviour.

Taylor R. Campbell <riastradh>
Group Member
Sun 25 Jul 2010 05:14:06 PM UTC, original submission:  

I'm using version 9.0.1 (actually git commit 2f3974e6fc01e28bbc5f4416bb76adf5d079c987) on Linux x86_64.

The documentation for directory-read says: "If directory has name, type, or version components, the returned list contains only those pathnames whose name, type, and version components match those of directory; wild or #f as one of these components means “match anything”."

However, it does not appear in reality as if #f means the same thing as 'wild, for example (comparing #f and 'wild in the name field to emulate looking for "*.scm"):

=================================================================

1 ]=> (directory-read (make-pathname #f #f '(absolute "home" "taylor") #f "scm" #f))

;Value: ()

1 ]=> (directory-read (make-pathname #f #f '(absolute "home" "taylor") 'wild "scm" #f))

;Value 448: (#[pathname 449 "/home/taylor/match.scm"] #[pathname 450 "/home/taylor/selector-test.scm"] #[pathname 451 "/home/taylor/validator.scm"] #[pathname 452 "/home/taylor/wiki2html.scm"])

=================================================================

The same goes for making the type field #f vs. 'wild.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mhb (Posted a comment)
  • -email is unavailable- added by riastradh (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-11 mhb StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code