beaussan / update-time-on-edit-obsidian

MIT License
165 stars 15 forks source link

Slight Correction To This Plugin Would Make It Perfect #71

Open richardstevenhack opened 7 months ago

richardstevenhack commented 7 months ago

Right now, this plugin uses the ctime and mtime from the operating system. I submit that this is incorrect for the following reasons:

1) ctime is not supported on various Linux file systems; e.g., ext4 uses crtime and btrfs used otime. This is a consistent problem with Obsidian plugins such as Dataview and others. 2) What is needed is the ability to detect when a file is edited IN OBSIDIAN and upon exit, the specified property field in the properties YAML header is updated with the CURRENT SYSTEM date/time - NOT the date and time from the file system.

This would eliminate issues of having to wait ten seconds to avoid Obsidian's backups interfering and of file time changes made by external programs such as copying the vault back and forth. This would narrow the modification to actual modifications made by the user who has actually edited the file and it directly uses the current system date instead of the file system dates to specify the modification date.

Thoughts?