comp.lang.ada
 help / color / mirror / Atom feed
From: Anders Wirzenius <anders@no.email.thanks.invalid>
Subject: Re: File list on Windows and Debian
Date: Wed, 21 Jun 2006 06:13:46 GMT
Date: 2006-06-21T06:13:46+00:00	[thread overview]
Message-ID: <uveqvavdx.fsf@no.email.thanks.invalid> (raw)
In-Reply-To: 1150790778.224228.282310@y41g2000cwy.googlegroups.com

"Ludovic Brenta" <ludovic@ludovic-brenta.org> writes:

> Anders Wirzenius writes :
> > I am trying to process files in a directory. They have to be processed
> > in alphabetical order. With following code I get a nice sorted list on
> > Windows XP but not sorted at all on Linux Debian. Have I missed
> > something that switches the sorting on on Debian (Sarge)?
> 
> I tried your program at home, and had to tweak it a little bit for it
> to compile. Then I also ghot unsorted directory entries, like I did
> with another program I wrote.
> 
> I think this is by design on GNU/Linux systems. They don't impose the
> overhead of sorting potentially large numbers of directory entries
> unless you really need to sort them.
> 
> If you insist on sorting, you'd have to do that yourself: first, store
> the directory entries (perhaps as GNAT.OS_Lib.String_Access values) in
> a container and sort it. I would suggest either GNAT.Dynamic_Tables and
> GNAT.Heap_Sort_G, or Charles.Vectors.Unbounded.Generic_Sort in the
> libcharles0-dev package. Beware however of unbounded memory usage.
> 
> HTH
> 
> -- 
> Ludovic Brenta.
> 

I found the package OS_Services which does the job. It uses
GNAT.Heap_Sort_G.

Many thanks to J-P Rosen for a very useful package.

-- 
Anders



      parent reply	other threads:[~2006-06-21  6:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19  8:09 File list on Windows and Debian Anders Wirzenius
2006-06-20  8:06 ` Ludovic Brenta
2006-06-20 10:23   ` Anders Wirzenius
2006-06-20 11:59     ` M E Leypold
2006-06-21  6:13   ` Anders Wirzenius [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox