I have some kind of reader which only has a handle (FILE*) to a file.
Another process keeps writing to a the same file which I don’t have control.
Now, as the other process appends images to that file, it is likely that soon the file size will cross 4 GB limit.
The reader process reads that file using the handle, offset and length of the image file which can be found from some DB.
My question is how would reader be able to read the chunk from the file which will be present after 4GB size.
I’m working on Win32 machine.
EDIT:
I’m working on FreeBSD machine as well.
On FreeBSD the stdio API is not limited to 32 bits(4Gb).
You should have no problems reading past 4Gb as long as you use a 64 bit integer to manipulate the offsets and lengths.
If you’re seeking in a FILE* , you’ll have to use fseeko() and not fseek() if you’re on a 32 bit host. fseek() takes a long which is 32 bit on 32 bit machines. fseeko() takes an
off_ttype which is 64 bits on all FreeBSD architectures.