In linux, is it possible to do partial reads on a regular file
- by Jimm
I need to write an application that spits out log entries to a regular file at a very fast rate. Also, there will be another process, that can read the same file concurrently at the time, other process would be writing to it.
I have following questions
How does read() determine EOF, specially in the case, where the underlying file could be concurrently being modified?
Is it possible for read() to return partially written data from the other process write? For example, the write process wrote half a line and read would pick that half line and return?
The application would be written in C on linux 2.6.x using Ex4 filesystem
UPDATE:
Below link points to the patch, that locks inode in EXT4, before reading and writing.
http://patchwork.ozlabs.org/patch/91834/