Re: Detecting new mail in mbox format
On 2009-04-23_23:17:58, Chris G wrote:
> I know mutt detects new mail in mbox format by comparing the last
> access time with the modification time of the file. However I can't
> find anywhere that tells me the exact logic.
>
> In particular if the last access time is the *same* as the
> modification time does mutt treat the mailbox as having new mail or
> not? It seems to me that it should treat this case as new mail but,
> from what I'm seeing it would seem that it doesn't.
>
> On my system (Ubuntu 8.10) it seems impossible to create a file with
> an access time before the modification time. One can *add* to an
> exisitng mailbox and set the modification time later than the access
> time but one cannot *create* a new mbox file with access before
> modification.
>
> --
> Chris Green
Not really helpful comment since you probably want to know about Mutt,
but it is easy to fudge the mtime of a file to anything you want using
touch. You can make the mtime of one file the same as another or just
pick a value out of the air and zap it into the inode. Limitation is
it must be a positive seconds since Unix Epoch and it must fit in the
actual unix time register on your machine so if you have an oldish
Linux, you might have difficulty assigning a future time beyond year
2038. ;-)
Slightly more helpful: Are you aware of the existence of ctime or
change time. If you display the atime and a test of how Mutt logic
work, you are not actually accessing the file, you are only accessing
metadata in the inode. This changes the ctime, and not the atime.
Maybe your test that leads you to believe there is a problem should be
described in more detail.
HTH
--
Paul E Condon
pecondon@xxxxxxxxxxxxxxxx