How to watch and read a file that another process is appending to?

Carlo Wood carlo at
Wed Jul 25 20:06:39 CEST 2018


can you please answer this question that I posted on
Stack Overflow:

	 When I add a watcher to read a file and all data has been read
then I do get a call back that there is data to read, but read(2)
returns 0 (EOF). At that point I have to stop the watcher or else it
will continue to tell me that there is something to read. However, if I
stop the watcher and then some other process appends data to that file
then I'll never see it.

What is the correct way to get notified that there is
additional/appended data in a file that can be read when before I
already read till the end?

Carlo Wood <carlo at>

More information about the libev mailing list