Sorting of folders
Jon LaBadie
mutter at jgcomp.com
Thu Jun 24 18:54:29 UTC 2021
On Thu, Jun 24, 2021 at 11:06:25AM +0100, Chris Green wrote:
>Is there any way that one can overcome this major disadvantage of
>maildir?
>
>Since maildir messages are saved in sub-directories of the named
>'maildir directory' there seems to be no practical way to do sorting
>of maildirs on anything but name.
>
>What I'd really like to be able to do is to sort on date of last
>message.
>
>For example I have a 'shopping/diy' directory which has lots of
>sub-directories like 'glue', 'grease', 'lynchpins', etc. It would be
>really handy if I could sort the directories within 'diy' by date as
>then the most used ones (or the most recently used ones) would be at
>the top of the listing and quicker to get to. However, as far as I
>understand things, this isn't possible with maildir as the date on the
>*directory* (e.g. the date on 'glue' or 'lynchpin') is the date of
>creation of the directory which might be years ago when I first bought
>some glue.
>
>If these were mbox mailboxes then they'd be a file whose date would
>reflect the last entry which would be exactly what I want.
>
The date you see with an "ls -l" is called "mtime", time of last
modification of the entries data. If it happens to match your
directories time of creation (which is not stored) it is coincidence.
For a directory, its data is the list of files it contains. So mtime
should change whenever an entry is added or removed. Note, renaming
and entry is typically add an entry, the new name as a link, then
unlink the old name.
Try sorting the directories according to mtime with ls -lt (or -ltr
for reverse order).
--
Jon H. LaBadie jon at labadie.us
11226 South Shore Rd. (703) 787-0688 (H)
Reston, VA 20190 (703) 935-6720 (C)
More information about the Mutt-users
mailing list