public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Writing past the 2GB file size boundary on 32-bit systems
@ 2008-01-07 14:24 Nick Maclaren
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Maclaren @ 2008-01-07 14:24 UTC (permalink / raw)
  To: gcc-help

"D. R. Evans" <doc.evans@gmail.com> wrote:
>
> Is there a clear description anywhere of how to use C++ streams and
> ordinary C FILE* functions so that they don't fail when an attempt to write
> to a file goes past the 2GB boundary?

No.

I can't begin to describe how messed up this area is.  I could start
with K&R C and AT&T Unix (which had excuses), ISO C and POSIX (which
didn't) and carry on from there.  The one thing that I can say is
that the compiler (i.e. gcc, sensu stricto) has nothing to do with
the matter.

This is entirely a library and operating system issue and, by the
sound of it, you are knackered.  You can try creating such a file
using the underlying POSIX calls and see if that works.  You may
need to specify O_LARGEFILE in the open call.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1@cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Writing past the 2GB file size boundary on 32-bit systems
@ 2008-01-07 12:30 D. R. Evans
  0 siblings, 0 replies; 3+ messages in thread
From: D. R. Evans @ 2008-01-07 12:30 UTC (permalink / raw)
  To: gcc-help

Sorry... originally posted from an unsubscribed account, which seems to
mean that some people saw it but it wasn't posted to the entire reflector.

I've also added some more detail.

----

Using gcc/g++ 3.3.1 on an old 32-bit Mandrake 9.2.1 production system
(which means that I can't update to anything newer).

Is there a clear description anywhere of how to use C++ streams and
ordinary C FILE* functions so that they don't fail when an attempt to write
to a file goes past the 2GB boundary?

I have found various vague comments and a few suggestions scattered around
various places, but nothing I've tried so far has worked. I've spent a day
and a half trying various things and figured it was now time to ask in a
place where people probably know how to get this working :-)

If anyone cares about the part of the problem I'm trying to solve first: I
have attached cout to a file using the mechanism in Josuttis pp 641-642. It
works fine until the file hits 2GB, at which point the program prints that
the file size limit has been exceeded and then terminates. This is true no
matter what macros I define (in particular -D_LARGEFILE_SOURCE and
_D_FILE_OFFSET_BITS=64).

  Doc Evans






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Writing past the 2GB file size boundary on 32-bit systems
@ 2008-01-07  0:08 D. R. Evans
  0 siblings, 0 replies; 3+ messages in thread
From: D. R. Evans @ 2008-01-07  0:08 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

Using gcc/g++ 3.3.1 on an old 32-bit Mandrake 9.2.1 production system
(which means that I can't update to anything newer).

Is there a clear description anywhere of how to use C++ streams and
ordinary C FILE* functions so that they don't fail when an attempt to write
to a file goes past the 2GB boundary?

I have found various vague comments and a few suggestions scattered around
various places, but nothing I've tried so far has worked. I've spent a day
and a half trying various things and figured it was now time to ask in a
place where people probably know how to get this working :-)

  Doc Evans






[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-06 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-07 14:24 Writing past the 2GB file size boundary on 32-bit systems Nick Maclaren
  -- strict thread matches above, loose matches on Subject: below --
2008-01-07 12:30 D. R. Evans
2008-01-07  0:08 D. R. Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).