<<< Date Index >>>     <<< Thread Index >>>

Re: 'mailboxes' command misbehaving?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>From: Khusro Jaleel <kerneljack@xxxxxxxxxxxxxx>
>User-Agent: Mutt/1.4.2.2i

>> Does the first Note in
>>    http://www.mutt.org/doc/manual/manual-3.html#ss3.11
>> apply to your case?
>
>Thanks for your reply, Steve, sorry for taking so long to reply myself.
>
>I don't think it applies, although I don't fully understand that first Note. 
>For example,
>I have (for access times):
>
>$ ls -ul mail/lists/
>total 380
>-rw------- 1 kjaleel kjaleel  90878 Jun 12 16:52 bind-users
>-rw------- 1 kjaleel kjaleel   3440 Jun 12 14:32 centos-devel
>-rw------- 1 kjaleel kjaleel   2797 Jun 13 11:08 mutt-users
>
>and for normal modification times:
>
>$ ls -l mail/lists/
>total 396
>-rw------- 1 kjaleel kjaleel  90878 Jun 13 19:02 bind-users
>-rw------- 1 kjaleel kjaleel   3440 Jun 12 14:32 centos-devel
>-rw------- 1 kjaleel kjaleel  19491 Jun 13 20:52 mutt-users
>
>So it seems the access times are in the past and the modification times are 
>when the mbox was last
>written to. So I don't think the first Note applies.

I don't know that much about mutt internals.  However, I think that
mtime > atime is why the first Note should apply.

Here's an example:

    # create a text file, set mtime & atime in the past
    $ date > foo.txt
    $ touch -a -m -t 200901010000 foo.txt

    # look at mtime, atime
    $ ls -l foo.txt
    4 -rw-r--r--  1 srevilak users 29 Jan  1 00:00 foo.txt
    $ ls -lu foo.txt
    4 -rw-r--r--  1 srevilak users 29 Jan  1 00:00 foo.txt

So, we have a file with one line, and both the atime and mtime are set
to midnight on Jan 1.

Next, let's append another line to the file, then see how it affects
atime and mtime.

    $ date >> foo.txt
    $ ls -l foo.txt
    4 -rw-r--r--  1 srevilak users 58 Jun 13 20:20 foo.txt
    $ ls -lu foo.txt
    4 -rw-r--r--  1 srevilak users 58 Jan  1 00:00 foo.txt

Above, we've changed the mtime by writing to the file.  However, atime
is still Jan 1.

Finally, by reading the file, we can change atime.

    $ wc -l foo.txt
    2 foo.txt
    $ ls -l foo.txt
    4 -rw-r--r--  1 srevilak users 58 Jun 13 20:20 foo.txt
    $ ls -lu foo.txt
    4 -rw-r--r--  1 srevilak users 58 Jun 13 20:23 foo.txt

This was done on CentOS 5.2, and I'm sure you'd see the same thing on
your CentOS 5.3 box.

Usually read() changes atime and write() changes mtime.  So, if mtime
> atime, that implies that the file has been written to since it was
last read.  For a mailbox, that implies new mail.

Would anyone more familiar with Mutt internals care to comment?

Steve

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (Darwin)

iEYEARECAAYFAko0RWEACgkQX7YJI4BuyDQTJQCeJtHecrRjt91vkYrFrtK9FJfB
PzwAnikgZt2AHeS167KDBkqexRAM7asN
=3Wur
-----END PGP SIGNATURE-----