watchdog icon indicating copy to clipboard operation
watchdog copied to clipboard

Watchdog not able to identify permission change events on a file

Open harshitkhanna opened this issue 4 years ago • 2 comments

I changed the permission of a file but no event was raised. Can we add support for permission/owner change events in watchdog?

I am using PollingObserver. Here is what I think is happening: PollingEmitter uses DirectorySnapshotDiff. DirectorySnapshotDiff considers modified files to be only those whose mtime changes. But changing permission (and hence metadata) doesnot change mtime. Should we add check for permission change as well?

harshitkhanna avatar Aug 31 '20 17:08 harshitkhanna

I think along with mtime, we should also check difference in ctime (https://docs.python.org/3.8/library/stat.html) This will give the modified event even on file metadata change event.

harshitkhanna avatar Aug 31 '20 20:08 harshitkhanna

I have same issue. Do you have any solution. Thanks

kchaksuvej avatar Apr 04 '22 20:04 kchaksuvej