HI Panos.
Thank you very much for the code.
The code is working.
But wouldn't it be a performance issue as the code is performing a lot of fopen() after it sees the file_size changes before closing and then reopening and fseek() to point to additional new data?
In the meanwhile, I had followed up the 'tail' utility code and had a kind of similar approached but used nanosleep() and then fstat() in a loop to adjudge the file_size before lseek() to point to the new data in the file.
In all your code worked to a great extent for me
Ya one another thing is that the file (was the SVR4 cpio archive having no CRC) and had a problem on my FreeBSD7 machine (I use it for multipurpose --one being a file server for me through samba connection, so all new UNIX file first go there before it goes on any other machine from my desktop).
It reported me an error like "cpio: premature end of file".
When I transfered the same to a RedHatLinux machine, it worked and extracted the directory
However the code was compiling and running on both machines but the output was taking time and strace and truss had problem attaching the executable, partially, I hope due to ignoring almost all the signal (installed earlier in the code).