Can you please explain me the inotify mechanism? I’ve searched in the web about it, but what I understood is that if I want to see the changes in a file I have to do polling with the “read” function. Is there any callback function which will notify me when the file has a change without polling?
Thanks,
I'm speculating that you are using some GUI library that handle events for you.
The better GUI libraries have a way to watch file descriptors. In GTK, it is gtk_input_add_full; in Qt, QSocketNotifier might work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With