Hey please don\'t mind if I am asking trivial question, but, please can somebody help me with this..
There are two parts:
Difference between pread
/pwrite
and read
/write
:
They are both at the same level, namely system calls. There are two differences:
Difference between read
/pread
/write
/pwrite
and fread
/fwrite
:
The "f" variants are standard runtime wrappers of the former (using the basic variants). They support in-process buffering. That can significantly improve performance for simple code, but it makes use of other features of the system-call level impractical.
Only use the "p" variants if you have good use for reading at random offsets (avoiding seeks and allowing concurrent access via one file handle), which often the case with some kind of database files (record-oriented with records at known offsets) and rarely in other applications.