I am watching files to detect changes in their content. But FileWatcher also fires a ChangeType.MODIFY event when the file is opened.
I can reproduce this at least on macOS, where the file system does persist the timestamp of the last time it was opened/accessed.
So technically opening a file (on macOS at least, possibly other OS) does change the file, so it justifies a ChangeType.MODIFY event.
But: It would be really great if developers could differentiate between opening a file and modifying it's content.
So how about introducing a new ChangeType.OPEN that would only fire, when the file's last open date is being modified. The ChangeType.MODIFY should then no longer fire, when the file's last open date is being modified.
I am watching files to detect changes in their content. But FileWatcher also fires a
ChangeType.MODIFY
event when the file is opened. I can reproduce this at least on macOS, where the file system does persist the timestamp of the last time it was opened/accessed.So technically opening a file (on macOS at least, possibly other OS) does change the file, so it justifies a
ChangeType.MODIFY
event. But: It would be really great if developers could differentiate between opening a file and modifying it's content.So how about introducing a new
ChangeType.OPEN
that would only fire, when the file's last open date is being modified. TheChangeType.MODIFY
should then no longer fire, when the file's last open date is being modified.