[plt-scheme] directory-list order?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Sep 13 11:54:28 EDT 2006

Just sort it. -- Matthias

   (require (lib "list.ss"))

   (define (read-directory)
     (define (path< p q)
       (< (file-or-directory-modify-seconds (path->string p))
          (file-or-directory-modify-seconds (path->string q))))
     (quicksort (directory-list) path<))

I know. We could use shorter names.


On Sep 13, 2006, at 11:16 AM, Gordon Weakliem wrote:

> It's definitely platform specific behavior at least - on Windows it  
> returns the list in alphabetical order.
>
> On 13 Sep 2006 05:20:12 -0000, Paul Graham < pg at ycombinator.com>  
> wrote:Is it defined what order directory-list returns filenames in?
> It currently seems to return files in order of creation.  This
> is extremely convenient for the app I'm writing, and it would
> be handy if I could count on it...  --pg
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
>
> -- 
> --
> Gordon Weakliem
> http://www.agileprogrammer.com/eightytwenty
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.