...
Some platforms may forbid a file simultaneously being opened multiple times, but other platforms may allow it. Therefore, portable code cannot depend on what will happen if this rule is violated.
Opening an already-opened file twice may in fact open a different file. For more information, see FIO45-C. Do not perform multiple file operations on the same filename.
Noncompliant Code Example
...