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

 
 

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

Submitted by:  None
Submitted on:  Sun 25 Jul 2010 05:14:06 PM UTC  
 
Category: runtimeSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: Taylor Venable
Originator Email: -unavailable-Open/Closed: Closed
Keywords: 

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

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

Matt Birkholz <mhb>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 11 May 2012 03:53:00 PM UTCmhbStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1