std.file.dirEntries unsorted

Timothee Cour thelastmammoth at gmail.com
Wed Dec 11 10:34:29 PST 2013


yes, I agree sorting should be explicit as there's no natural order.
However sorting after calling dirEntries is not great as typically one
wants to sort within a given directory level and it's too late to sort once
all the directory levels are flattened.
so how about having an extra argument that takes a lambda (eg
binaryFun!"a<b") in dirEntries, or, having an additional function in
std.file that takes such lambda.


On Wed, Dec 11, 2013 at 2:31 AM, Marco Leise <Marco.Leise at gmx.de> wrote:

> Am Wed, 11 Dec 2013 08:00:27 +0100
> schrieb "Jesse Phillips" <Jesse.K.Phillips+D at gmail.com>:
>
> > It should only be documented. In my experience processing files
> > don't need a particular order and sorting may not be needed by
> > name.
> >
> > Returning a sorted directory is difficult to define, should
> > directories come first or be mixed with the files. Is uppercase
> > grouped together? Does A come before a. Should the extension be
> > included or postponed for later.
> >
> > I think sorting should be explicit.
>
> Does 2.jpg come after 10.jpg ? What's the order of
> Arabic-Indic "one" ۱ compared to "Latin one" 1 ? And so on and
> so forth.
>
> --
> Marco
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131211/ca060839/attachment.html>


More information about the Digitalmars-d-learn mailing list