From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,660973a335e8cfa0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!y41g2000cwy.googlegroups.com!not-for-mail From: "Ludovic Brenta" Newsgroups: comp.lang.ada Subject: Re: File list on Windows and Debian Date: 20 Jun 2006 01:06:18 -0700 Organization: http://groups.google.com Message-ID: <1150790778.224228.282310@y41g2000cwy.googlegroups.com> References: NNTP-Posting-Host: 212.123.3.11 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1150790783 2370 127.0.0.1 (20 Jun 2006 08:06:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 20 Jun 2006 08:06:23 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; SunOS sun4u; fr-FR; rv:1.6) Gecko/20040116,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 KUUPXS02 Complaints-To: groups-abuse@google.com Injection-Info: y41g2000cwy.googlegroups.com; posting-host=212.123.3.11; posting-account=ZjNXewwAAADyBPkwI57_UcX8yKfXWOss Xref: g2news2.google.com comp.lang.ada:4851 Date: 2006-06-20T01:06:18-07:00 List-Id: 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.