maximum file positions using fstream?

Hey There...

I have the following question:

While using fstream file-operations and searchin/counting/etc file positions;

Is the maximum number of positions i can work with limited to the streampos-type?...

for example "tellg()" returns the current position as streampos which is typedef fpos<_Mbstatet> streampos

and _Mbstatet is int

hmmmm...
Yeah, addressing beyond 2Gb is typically a problem for most OSes and for the runtime library because most file position parameters are defined as (signed) ints.

You could try casting the return code to unsigned and that will get you up to 4Gb.
To seek to a position beyond the 2Gb boundary, use SEEK_END.
Topic archived. No new replies allowed.