Posts: 19
Threads: 3
Joined: Oct 2017
Reputation:
0
Its possible to read one file twice at same time?
Posts: 41
Threads: 2
Joined: Jan 2013
Reputation:
0
I believe you should be able to, don't see why you wouldn't be able to.
Try it and see for yourself.
Posts: 578
Threads: 40
Joined: Dec 2016
Yeah, file handles has got a special ID out of fopen.
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
Yes you can. You can also write to it while it is opened in another handle, but only the text of the last time you close it will save.
Eg. you open a file twice in write mode.
In the first you write "hello", and the second "test".
When you close the first one, "hello" will be stored, and when you close the second "test" will be stored and overwrite the previously stored content.
You can also open the same file twice and write different stuff in both, then use fseek and read the individual content of it. You will basically have 2 different files from which you can read/write, but upon closing it will overwrite.
This is for Windows, there might be a different behaviour on Linux!