I have a file opened with fopen
. There is a way to reopen the same file (while it is opened) but have a different seek? (so i can use fread independently)
there is no problem if you keep reading only.
Be careful if you write in the file especially if you have 2 threads that access with read/write to the file at the same time
If your code looks like that
FILE *fp1, *fp2;
fp1 = fopen("file", "r");
fp2 = fopen("file", "r");
then you have 2 seeks in the same file. and the position of seeks are independent. reading from fp1
does not have any impact in fp2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With