I have a set of several thousand files that are automatically re-generated every 24-hours (e.g. ports-readmes on OpenBSD).
Most of the time, the content of these files doesn't change, but since they are re-created, the mtime
does change.
Without modifying the original app which re-generates the files in place, how would I cache the mtime based on the filename/sha1 pairs, and restore after the regeneration if sha1 stays the same? Prefer python
, but any UNIX solution is welcome.
(I require this for a sitemap, since the sitemap spec only has lastmod
for versioning.)