From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!s28g2000vbp.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Large files on 32 and 64 bits ystem Date: Mon, 25 May 2009 16:23:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: <93b17897-d40d-4c96-84a2-f0221a71843e@s28g2000vbp.googlegroups.com> References: <4a1aedda$0$2855$ba620e4c@news.skynet.be> NNTP-Posting-Host: 94.108.148.252 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243293787 15816 127.0.0.1 (25 May 2009 23:23:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 25 May 2009 23:23:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s28g2000vbp.googlegroups.com; posting-host=94.108.148.252; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030810 Iceweasel/3.0.9 (Debian-3.0.9-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6011 Date: 2009-05-25T16:23:07-07:00 List-Id: On May 25, 9:13=A0pm, Olivier Scalbert 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.