You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder what is the best way to achieve what I want, which sounds to me like a pretty common use case. Would love to get some advice 🙏
At a high level, I have an application that watches file changes in a specific folder. Files/dirs can be added/removed/modified.
Changes can be categorized into two categories:
Application changes - in some cases my application makes changes to the files under watch
External changes - in some cases, an external change may occur in the files under watch
I would like to be able to distinguish both types of changes.
In changes of type (1) I want to perform a different action from the one I need to perform in changes in type (2).
Currently, to do this, I hold a map of all files and directories in which I keep a last-modified timestamp and compare it using fs.Stats. This feels hacky and a lot of work for a feature I imagine is very much a common use case, but I might be mistaken.
Hopefully, my description of the problem is clear.
I would appreciate any advice!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I wonder what is the best way to achieve what I want, which sounds to me like a pretty common use case. Would love to get some advice 🙏
At a high level, I have an application that watches file changes in a specific folder. Files/dirs can be added/removed/modified.
Changes can be categorized into two categories:
I would like to be able to distinguish both types of changes.
In changes of type (1) I want to perform a different action from the one I need to perform in changes in type (2).
Currently, to do this, I hold a map of all files and directories in which I keep a last-modified timestamp and compare it using
fs.Stats
. This feels hacky and a lot of work for a feature I imagine is very much a common use case, but I might be mistaken.Hopefully, my description of the problem is clear.
I would appreciate any advice!
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions