mardi 30 décembre 2014

seek function in unix


I try to understand the seek(2) function from Unix version 6.


This example:



seek(0,0,2)


So the first argument is the file descriptor. And 0 would be the standard input. The second argument is the offset, which is 0. And the third argument tells us according to man page "the pointer is set to the size of the file plus offset."


But why would you do this? Why would you point after the file?


The line is from the source code.



Aucun commentaire:

Enregistrer un commentaire