I want to store pointers to file's line numbers in an array and later I want to retrieve the specified line from disk. I can not store pointer to line number directly as when I read the file back the memory locations would have changed. So, I am storing the offset from the beginning of the file instead. For storing the offset I am using "uint_64t". However since my file size is 200GB therefore "uint_64t" is not able to represent all the offsets.
I have the following questions:
Other than storing offsets, is there some other way by which I may store pointers to file stored on disk.
Is there some other data structure which I may use (other than uint64_t).
On POSIX systems, off_t
is the standard type for file offsets. It's probably a 64-bit type, though, just like uint64_t
, as those can hold values on the order of 2e11 without trouble.
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