What is the difference between read and pread in unix?

前端 未结 4 2094
孤城傲影
孤城傲影 2020-12-13 06:59

What is the difference between the functions read() and pread() in unix?
When choosing between them, what points should I take into considerati

4条回答
  •  猫巷女王i
    2020-12-13 07:14

    Google gave me man pread.

    If you read() twice, you get two different results, which shows that read() advances in the file.

    If you pread() twice, you get the same result, which shows that pread() stays at the same point in the file.

提交回复
热议问题