[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#258262: ITP: sortdir -- wrapper program to make files show up in sorted order



On Tue, 13 Jul 2004, Gergely Nagy wrote:

> I believe that those who know how to use rsync and actually want their
> tarballs to be rsyncable, can come up with a perl script in no time that
> sorts the output of find -print0 (just slurp the input into a big
> scalar, split it into an array by \0, and sort it, then print it,
> bingo), so they won't have much use for sortdir.

I fail to see the advantage in doing that. Feels like reinventing the
wheel :(

This will work with any program using opendir, readdir & friends and
feed <your app> with an already sorted list:

  # sortdir <your app>

Your suggested approach adds a few extra layers:

1. perl script to sort a list produced by...
2. find

You also do not know how in what maner <your app> will take those file
names.

IMHO, the sortdir (LD_PRELOAD) approach is more straight forward than
your suggested solution. It certainly looks like sortdir has
simplicity, flexibility, better performance and memory footprint
advantages.


Cheers,
Cristian



Reply to: