Join Nostr
2026-01-27 14:40:00 UTC
in reply to

Ammar Nofan Faizi on Nostr: BTW, you can monitor file deletion using the inotify syscall. You can register the ...

BTW, you can monitor file deletion using the inotify syscall. You can register the inotify fd into your epoll and wait for EPOLLIN.

Several months ago, Ahmad Ghani and I used inotify to monitor changes on a credential file in the gwproxy project.

Check this out:
https://github.com/GNUWeeb/gwproxy/blob/60c6c822cf8ab14d80800776435417238ea371b0/src/gwproxy/gwproxy.c#L640-L641

But in this case, I think you should use IN_DELETE_SELF instead of IN_DELETE.

See: man 7 inotify

https://man7.org/linux/man-pages/man7/inotify.7.html