[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Operations in order of timestamps
From: |
Eli Zaretskii |
Subject: |
Re: Operations in order of timestamps |
Date: |
Sat, 07 Feb 2009 11:37:12 +0200 |
> Date: Sat, 7 Feb 2009 00:49:47 -0500
> From: Satyendra Kumar Rai <address@hidden>
>
> I need to a perform a specific operation on a list of files in a given
> directory in the order of the timestamps. Can someone please tell me how to
> go about this?
Use `directory-files-and-attributes' to generate a list of all the
files in a directory with their attributes. One of these attributes
is the file's time stamp (for the details, see the doc string of
`directory-files-and-attributes'). Then use the `sort' primitive to
sort the list of the files by that attribute. `sort' accepts a
predicate function for comparing 2 elements, so you will need to write
such a predicate. You can find an example of such a predicate in
ls-lisp.el, it's called `ls-lisp-time-lessp'.
Happy hacking!