comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Large files on 32 and 64 bits ystem
Date: Mon, 25 May 2009 16:23:07 -0700 (PDT)
Date: 2009-05-25T16:23:07-07:00	[thread overview]
Message-ID: <93b17897-d40d-4c96-84a2-f0221a71843e@s28g2000vbp.googlegroups.com> (raw)
In-Reply-To: 4a1aedda$0$2855$ba620e4c@news.skynet.be

On May 25, 9:13 pm, Olivier Scalbert <olivier.scalb...@algosyn.com>
wrote:
> Hello everybody,
>
> Here is my weekly question ....
>
> I need to create a file that has 2540160000 bytes, that is a little more
> than 2**31 bytes.
>
> On a 64 bits linux box, it is ok, but on a 32 bits linux box, I have:
> raised ADA.IO_EXCEPTIONS.DEVICE_ERROR : s-fileio.adb:1135

That line indicates that the GNAT run-time library delegates the write
to fwrite(3), so your question really boils down to whether the C run-
time library has support for large files or not.  What filesystem type
do you use on your machines? (I use XFS which supports files up to 8
exabytes :) )

> The file length is: 2147483647, which is 2**31 - 1

This limitation exists on FAT16 ("msdos" in Linux parlance). Newer
filesystems have higher limits.

> Is it possible to write more than 2**31 bytes with an Ada program on a
> 32 bits linux ?

32-bit Linux has "large file support" using either a dedicated 64-bit
API or the O_LARGEFILE flag supported in open(2) since glibc 2.2. It
might be a good idea to check how GNAT's run-time library deals with
this API but I don't have the time right now. Anyone?

--
Ludovic Brenta.



  reply	other threads:[~2009-05-25 23:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25 19:13 Large files on 32 and 64 bits ystem Olivier Scalbert
2009-05-25 23:23 ` Ludovic Brenta [this message]
2009-05-26  5:14   ` Olivier Scalbert
2009-05-26 10:22     ` Ludovic Brenta
2009-05-26 13:26       ` Robert A Duff
2009-05-26  0:49 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox