Hi, just wanted to know how to open a file with filesize greater than 3gb using fopen() command or is there another way of doing it aside from fopen().
I seem to recall reading about this some time ago...
Functions like fopen() and the like should work just fine with huge files. You just can't fseek() on them properly. (But I'm not 100% certain on that.)
it seems OS is limited to open 2gb as input file on fopen()... that is why i'm seeking some options on how can i convert a text file greater than 2gb to a binary file format... any help would be greatly appreciated
No, Duoas is right. The limitation comes from fseek, not fopen nor the OS. fseek only takes a signed int, so seeking past 2^31-1 bytes is impossible. You can, however, read as many bytes as you want starting from that point, which could be a workaround if the file is not much bigger than the limit.
Hmm... fopen64()... I wonder if there's a C++ equivalent...
EDIT: Although it seems it's not even standard. I heard Boost has something for this purpose.
It depends on the OS. Older OSes might give you trouble if you don't use fopen64(), but modern kernels shouldn't give you any grief at all. Thanks for the clarification helios.