comp.lang.ada
 help / color / mirror / Atom feed
From: M E Leypold <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de>
Subject: Re: File list on Windows and Debian
Date: 20 Jun 2006 13:59:01 +0200
Date: 2006-06-20T13:59:01+02:00	[thread overview]
Message-ID: <te3be0jawq.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: uodworuqx.fsf@no.email.thanks.invalid


Anders Wirzenius <anders@no.email.thanks.invalid> writes:

> "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.

That is correct. I suppose that the Gnat directory functions just
interface to readdir(3) and with readdir() the order of entries is
dependend on the underlying filesystem. In ext2fs this is AFAIS the
order in which they are written (a directory is just a file with
dirent records, actually), with xfs (which uses btrees internally)
entries get retrieved mostly sorted but AFAIR "." and ".." are not the
first two and so on. I'd expect different results for reiser fs also.

Regards -- Markus






  reply	other threads:[~2006-06-20 11:59 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 [this message]
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