I am reading the content of a File
from start to finish (would usually do this with a FileInputStream
, but I am not bound to that).
While I am reading the file, other processes might append into that file. That's not a problem, as long as I am reading from the file. But when I am done, I would need to have either one thread per file waiting for input (blocking read) or try to read the file regulary (polling).
I would prefer to use something like select
for Socket
s, but as far as I found information on that topic FileChannels
are always blocking...
What I want to archieve is somewhat like tail -f
does on Linux command line. I need to know when there is more data to read...