* GNAT Ada.Direct_IO bug
@ 2014-09-07 12:58 Dmitry A. Kazakov
2014-09-07 14:28 ` Pascal Obry
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry A. Kazakov @ 2014-09-07 12:58 UTC (permalink / raw)
I have verified this under Windows 7 64-bit (NTFS) and 32-bit Linux and
Fedora. It seems that the implementation of GNAT Ada.Direct_IO is limited
to 2Gb file sizes regardless that the underlying OS has no such constraint.
Here is the test program:
------------------------------------------------------------
with Ada.Direct_IO;
with Ada.Text_IO; use Ada.Text_IO;
procedure Test_DIO is
type Block is array (1..1024) of Character;
for Block'Size use 1024*8;
package DIO is new Ada.Direct_IO (Block);
File : DIO.File_Type;
Data : Block := (others => ' ');
begin
DIO.Create (File);
for Giga in 1..2 loop
for Mega in 1..1024 loop
for Kilo in 1..1024 loop
DIO.Write (File, Data);
end loop;
end loop;
Put_Line ("File size" & DIO.Count'Image (DIO.Size (File)) & "
Kbytes");
end loop;
end Test_DIO;
-------------------------------------------------------------
Under Windows [GNAT GPL gpl-2014 (20140405)] it silently wraps the file to
zero size. So the output looks like:
>test_dio.exe
File size 1048576 Kbytes
File size 0 Kbytes
32-bit Debian [4.9.1 (Debian 4.9.1-4)] exposes the same behavior as
Windows.
[64-bit Fedora and Debian work as expected]
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GNAT Ada.Direct_IO bug
2014-09-07 12:58 GNAT Ada.Direct_IO bug Dmitry A. Kazakov
@ 2014-09-07 14:28 ` Pascal Obry
0 siblings, 0 replies; 2+ messages in thread
From: Pascal Obry @ 2014-09-07 14:28 UTC (permalink / raw)
Le dimanche 07 septembre 2014 à 14:58 +0200, Dmitry A. Kazakov a
écrit :
> I have verified this under Windows 7 64-bit (NTFS) and 32-bit Linux and
> Fedora. It seems that the implementation of GNAT Ada.Direct_IO is limited
> to 2Gb file sizes regardless that the underlying OS has no such constraint.
> Here is the test program:
Right. And this is fixed in recent GNAT versions. Should be working with
GNAT GPL 2015.
--
Pascal Obry / Magny Les Hameaux (78)
The best way to travel is by means of imagination
http://v2p.fr.eu.org
http://www.obry.net
gpg --keyserver keys.gnupg.net --recv-key F949BD3B
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-07 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-07 12:58 GNAT Ada.Direct_IO bug Dmitry A. Kazakov
2014-09-07 14:28 ` Pascal Obry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox