What are the advantages of pwrite and pread over fwrite and fread?

前端 未结 3 1299
温柔的废话
温柔的废话 2021-02-05 05:24

Hey please don\'t mind if I am asking trivial question, but, please can somebody help me with this..

3条回答
  •  忘了有多久
    2021-02-05 05:40

    Current file position doesn't change after a call to pread/pwrite.

    Also because you don't need to call lseek to change the current file position pread/pwrite avoid potential race conditions when multiple threads are involved.

提交回复
热议问题