2.5 KiB
Use timestamps for effectively future-proofing your stuff
One of the simplest ways to future-proof your documents with File metadata is to create a timestamp. Specifically, two timestamps: one when it's created and one when it was last modified which will be continuously updated each time we modify the file. This lets you quickly evaluate whether the information is up-to-date. It also lets you Maintain your own digital library with relative ease if your focus is on up-to-date information.
In order to make updating the modification timestamp worth not to make it a chore, it is best to automate that task. 1
Different files may be applied differently as long as we can create a unified interface to search through them all. (See File metadata for more information about it.)
Here's a special example with Org-mode documents:
Thankfully, Emacs has a time stamp feature that abstracts that for us. We can then attach the timestamp update with a hook that will occur before saving the file and voila! Automated timestamp for our text documents.
Here's my (Doom Emacs) specific config as of 2020-09-17 for future references:
(after org!
(setq
; Set a custom time-stamp pattern.
; Even though, it's not recommended, most of the time,
time-stamp-start "DATE_MODIFIED:[ ]+\\\\?[\"<]+"))
; Modify the time-stamp with each save.
(setq time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S%:z")
(add-hook 'before-save-hook 'time-stamp)
This should be easily replicated to other editors. All you need from a text editor is the hooks and a search-and-replace feature 2.
For binary files, we can set the timestamp with a metadata writer then use a filesystem watcher and configure it to execute every time the file changes.