ifstream with files > "GB

T

tom

have seen a few posts about this but no solutions.

files larger than 2Gb don't open with ifstream.open

ie.

#include <fstream>
int main(in argc, char** argv){
ifstream in ;
in.open("3GBfile");
cout<<in.is_open()<<endl;
};


gives 0 as its output.



using g++ 3.3.1 on linux kernel 2.4, with the following shared libs

libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40034000)
libm.so.6 => /lib/i686/libm.so.6 (0x400f4000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40117000)
libc.so.6 => /lib/i686/libc.so.6 (0x4011f000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
 
V

Victor Bazarov

tom said:
have seen a few posts about this but no solutions.

files larger than 2Gb don't open with ifstream.open

ie.

#include <fstream>
int main(in argc, char** argv){
ifstream in ;
in.open("3GBfile");
cout<<in.is_open()<<endl;
};


gives 0 as its output.



using g++ 3.3.1 on linux kernel 2.4, with the following shared libs

libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40034000)
libm.so.6 => /lib/i686/libm.so.6 (0x400f4000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40117000)
libc.so.6 => /lib/i686/libc.so.6 (0x4011f000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

A solution, if any, would be implementation-specific. Please ask in
gnu.g++.help for it.

The size of the file a library is capable of accessing successfully
depends on the size of the native CPU word and the OS' implementation of
file system. Folks in a Linux newsgroup could also tell you how to work
around the problem. Try comp.os.linux.development.apps

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,057
Messages
2,570,443
Members
47,113
Latest member
XZJMike318

Latest Threads

Top