From: anon@anon.org (anon)
Subject: Re: Large files on 32 and 64 bits ystem
Date: Tue, 26 May 2009 00:49:19 GMT
Date: 2009-05-26T00:49:19+00:00 [thread overview]
Message-ID: <j0HSl.30179$d36.10297@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 4a1aedda$0$2855$ba620e4c@news.skynet.be
With GNAT:
Ada.Direct_IO uses a file indexes that has the type of Count or Positive_Count.
And these types are based on the positive range which is define as the size of a
long_Integer which is normally in a 32-bit machine set to positive value of
( 2**63 - 1 ).
So it is possible from Ada, but the interface links between Ada and the OS
may limit the size. Or in some cases it could be the OS or device-drivers
that is limiting the file size.
But in looking at the routine System.FileIO.Write_Buf where the exception
occurred and the Interfaces.C.Streams they both limit the file size to
Standard'Address_Size or in the case of GNAT 32-bit version, to a positive
range of 32-bit word aka (2GB -1).
So, the answer is: On a 64-bit machine is limited to 2**64-1 file size
and
on a 32-bit machine is limited to 2**32-1 file size.
In <4a1aedda$0$2855$ba620e4c@news.skynet.be>, Olivier Scalbert <olivier.scalbert@algosyn.com> writes:
>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
>
>The file length is: 2147483647, which is 2**31 - 1
>
>Is it possible to write more than 2**31 bytes with an Ada program on a
>32 bits linux ?
>
>Thanks for your help,
>
>Olivier.
prev parent reply other threads:[~2009-05-26 0:49 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
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 [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox