How many independent pointers / file positions are there on Windows?
If I open the same file (using CreateFile ()) twice in the same stream, so that I have two valid handles at the same time, will the two file descriptors have a common "file pointer" (SetFilePointer ()) or will the two handles have separate independent "file pointers"?
What if there are two parallel threads in the same process, and each of them holds one descriptor in the same file. Will these two handles have independent file pointers?
source to share
Each time a stream opens a file, a new file object is created with a new set of descriptor-specific attributes. For example, the current byte offset attribute refers to the location in the file where the next read or write operation will be performed using this handle. Each file descriptor has a private byte offset, although the main file is shared. A file object is also unique to a process, unless the process duplicates a file descriptor to another process (using the DuplicateHandle> function ) or when a child process inherits a file descriptor from a parent process. In these situations, the two processes have separate descriptors referring to the same file. Windows Internals 5th
source to share