[iostreams?] Working with files larger than 4gb.

To my surprise, the implementation of the STL shipped with VC9 does not support files larger than 4GB. I was pretty surprised and couldn't find anything on the web to the contrary. So I was wondering if boost has any hidden libraries that might assist in solving my problem. Thanks.

Raindog, On Sunday 16 November 2008 17:41:32 Raindog wrote:
To my surprise, the implementation of the STL shipped with VC9 does not support files larger than 4GB. I was pretty surprised and couldn't find anything on the web to the contrary. So I was wondering if boost has any hidden libraries that might assist in solving my problem.
Yes, it is surprising :-) You can use boost::iostreams::file_descriptor to read large files. If you need to keep track of positions in the file, you will want to use boost::iostreams::stream_offset. Hope This Helps, Justin

Raindog wrote:
To my surprise, the implementation of the STL shipped with VC9 does not support files larger than 4GB. I was pretty surprised and couldn't find anything on the web to the contrary. So I was wondering if boost has any hidden libraries that might assist in solving my problem.
Thanks.
According to std::numeric_limitsstd::streamsize::max(), on VC9 (true also on Codegear 6.10, MinGW 4.3.2) 2GB is the largest file size supported. I have read that STLPort has support for large files but I haven't tested it. Cheers, Cristian.

Cristian Adam wrote:
I have read that STLPort has support for large files but I haven't tested it.
I've tested the following program (VC8.0): #include <streambuf> #include <limits> #include <iostream> int main() { using namespace std; cout << numeric_limits<streamsize>::max() << endl; } compiled with STLPort as: D:\projects\STLport-5.1.7 $ cl test.cpp /I stlport /link /libpath:lib resulted in: $ test 9223372036854775807 While just a normal compilation: $ cl /EHsc test.cpp resulted in: $ test 2147483647 Hope this helps. Cheers, Cristian.
participants (3)
-
Cristian Adam
-
KSpam
-
Raindog