On 28.06.2017 06:53, ra...@openmailbox.org wrote:
On 2017-06-01 04:45, Pádraig Brady wrote:
On 31/05/17 15:24, ra...@openmailbox.org wrote:
Existing tools like find(1) were thought sufficient

but find does not support sorting by date which ls does.

I hope this patch can be reconsidered for inclusion.

Rather than the obvious: patching find so that it supports sorting the paths
by date, or other properties?

This could be a "-sort <spec>" predicate, which is understood to be like
"-print", except it sends the visited node into a sorting bucket, which
is spilled when find finishes executing.  Sort buckets are identified by
the "<spec>" syntax as a key, so multiple occurrences of the predicate
giving the same <spec> go to the same bucket. Multiple occurrences of -sort
with different keys route to different buckets; these buckets can be
later dumped in left to right order, based on the position of the
leftmost predicate which specifies each bucket.

<spec> could use + and - as prefixes for ascending and descending (defaulting to + if omitted) followed by a word which is derived from the space of predicates:
atime, ctime, name, iname, ...

Comma separation for compound keys? -sort mtime,name

Something like that.

Reply via email to