The GNU C Library - File Position Go to the first , previous , next , last section, table of contents . File Position One of the attributes of an open file is its file position that keeps track of where in the file the next character is to be read or written. The file position is normally set to the beginning of the file when it is opened, and each time a character is read or written, the file position is incremented. In other words, access to the file is normally sequential .
Ordinary files permit read or write operations at any position within the file.
Some other kinds of files may also permit this. Files which do permit this are sometimes referred to as random-access files. However, the file position is still used to control where in the file reading is done. If you think about it, you'll realize that several programs can read a given file at the same time. In order for each program to be able to read the file at its own pace, each program must have its own file pointer, which is not affected by anything the other programs do.