Re: [PATCH] Change attachment stamping to use stat st_mtime by default.

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Fri, Aug 21, 2026 at 04:14:29AM +0200, Vincent Lefevre wrote:
>On 2026-08-20 17:26:01 -0400, Reed Underwood wrote:
>> Would it be preferable to just use gettimeofday (or another function that
>> guarantees subsecond precision) and use only the seconds?
>
>gettimeofday is no longer in any standard. It was replaced by
>clock_gettime. But anyway, it is not possible to know which clock
>is the same as the one used for the filesystem. Since the value
>will be compared to st_mtime from stat(), it is better to also
>use stat() for the comparison.

I agree.  This is all taking place during message composition, and 
generally the stamp is used for a file that has just been read.  So 
there isn't likely to be much slowdown with taking a stat() for the 
file.

I've tried to reword the commit message.  It's probably too verbose now, 
but better that than too terse, as it was.  I'll send it out shortly for 
review.  Please let me know if my wording is okay.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmqH0AkACgkQre92hIAx
a9rXSxAAzoEJY+iuuCdK72haxjtbdFCkKm0hS1hkrEAjHAtJn4ezmhmhJyZZ8MY8
XB9frW50Zxq/fzS2wc6D6xmjxzqTq6T4YsyRzQX9tgfaO6BnXJ2dq8+/GBr04b9e
7EeTr5IeXNXb3A5aKIi5tr+YZrUhD1gxJP2yz6yjyMdldJGoFuQFH+u8cpyq7ij/
oX29xjwABLdvIQpFoGNcEgJLZM34krZGPSws6YxuhK7CF+2m+OfFa/1hTLpEQVay
HqF/3hi5GVlBk5yb5uyKa+95Xnrx2qhf7ggFN96e5rl9yZ4Ljc4bWgC7Xy4AmyT5
Zl0uBGQh5r/kTO8ZSWZSxe6K5FxJXZ6zS9jgiCaqxuagS3ejhSKLNtVCVSDrTpor
8XmmP222FHckWNhmsXsSsMSDn8oOZGYA4rn7Zgep9AUJrO29NYqxM03Lk4yMy37j
gbVDyXyUirJwpEK5zMKRqalafNWFnje3HA9GiyOSEXtiY6vQLF/Vm2a8g2mtkQcw
X8PNgdS1TNrRusXlYrJOOkK/tRtauZx02dYqFrkHOl9u+l7kUjczyEH/bznmvuT7
DbA7Kb8pltOT+v/0NtE5FBBS+QRQOA+A15nRav4/Q7uJ9WxEgrhwnj7z4i/XiTtB
HImpFzFInjlRK3SzVkRmK29igwhXnBx1TRYMRuSagO5WwUY0+ak=
=1P+Q
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.