in reply to Re: inotify problem
in thread inotify problem

Thanks a lot for your point about the editor.

In fact my code is working but I had been trying to track changes to a file made with vim.

The problem was that I use a "backup"-option in my vimrc and what vim then seems to do is to move the original file to the backup-folder and continue to work on a copy. The copy has the same name as the watched file but of course a different inode-number, so subsequent changes are not detected by inotify.

I wanted to use inotify to avoid polling but in the light of this I would also have to watch the directory to detect such things and the extra complexity is probably not worth it.

Or is there another way to discover changes made to a file given by name (i.e. whose inode could change) apart from polling it?