Michel Rosien wrote in news:bkbp28$njq$1@ares.cs.utwente.nl:
[repost - I sent the previous by accident before I was finnished]
[color=blue]
> I am trying to read data from a textfile using std::ifstream.
> The problem is that I have a very huge text file, approximately 4.8
> GB. When I use this file, the program I wrote refuses to read in every
> line of the file,
> after a while it just stops, it doesn't reach the last line of the
> file. When I use smaller files it works perfectly.
>
> Is there a maximum filesize limit for std::ifstream?[/color]
Yes, but its implementaion ( C++Builder5 in your case ) defined.
Its probably 2GB ( pow( 2, 31 ) ).
[color=blue]
> Or could this be an operating system or compiler issue?
> (I use Borland C++Builder5 and Windows2000 with NTFS)
>[/color]
A simple solution may be to change the way your programme works
from:
yourprog bigfile
to:
yourprog < bigfile
And read you data in from std::cin, do write a small test programme
first, just to check std::cin doesn't have the same problem.
If that doesn't work you'll need a platform specific solution, goto
MSDN
http://msdn.microsoft.com/ and look for CreateFile to start
with.
HTH
Rob.
--
http://www.victim-prime.dsl.pipex.com/