comp.lang.ada
 help / color / mirror / Atom feed
From: "Ludovic Brenta" <ludovic@ludovic-brenta.org>
Subject: Re: File list on Windows and Debian
Date: 20 Jun 2006 01:06:18 -0700
Date: 2006-06-20T01:06:18-07:00	[thread overview]
Message-ID: <1150790778.224228.282310@y41g2000cwy.googlegroups.com> (raw)
In-Reply-To: <uhd2h4ldc.fsf@no.email.thanks.invalid>

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.




  reply	other threads:[~2006-06-20  8:06 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 [this message]
2006-06-20 10:23   ` Anders Wirzenius
2006-06-20 11:59     ` M E Leypold
2006-06-21  6:13   ` Anders Wirzenius
replies disabled

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