How should I deal with copying and renaming in monitoring of files?

Hey there,

I am working on a project where I am monitoring the files in which there are certain conditions like renaming, copying, updating, or nothing. It deals with path and content(hash Blake2s256).

  • For Nothing, the condition is path matched + content(hash) is same.
  • For Update, the condition is path matched + content(hash) is different.
  • For Copy, the condition is path not matched + content is not found.
  • For Rename, the condition is path not matched + __.

Now I am confused about copying and renaming. For copying, even if the content is not found, there is still a hash generated for an empty file and for the rename, I am confused that what should be put overall.

Thank you!

What API are you consuming filesystem changes through?

What do you want your system to do differently when a file is copied, or renamed, from what it would do if you treated those as generic additions or deletions?