Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,23 +0,0 @@
|
|||
with Ada.Directories,
|
||||
Ada.Direct_IO,
|
||||
Ada.Text_IO;
|
||||
|
||||
procedure Whole_File is
|
||||
|
||||
File_Name : String := "whole_file.adb";
|
||||
File_Size : Natural := Natural (Ada.Directories.Size (File_Name));
|
||||
|
||||
subtype File_String is String (1 .. File_Size);
|
||||
package File_String_IO is new Ada.Direct_IO (File_String);
|
||||
|
||||
File : File_String_IO.File_Type;
|
||||
Contents : File_String;
|
||||
|
||||
begin
|
||||
File_String_IO.Open (File, Mode => File_String_IO.In_File,
|
||||
Name => File_Name);
|
||||
File_String_IO.Read (File, Item => Contents);
|
||||
File_String_IO.Close (File);
|
||||
|
||||
Ada.Text_IO.Put (Contents);
|
||||
end Whole_File;
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
with Ada.Text_IO,
|
||||
POSIX.IO,
|
||||
POSIX.Memory_Mapping,
|
||||
System.Storage_Elements;
|
||||
|
||||
procedure Read_Entire_File is
|
||||
|
||||
use POSIX, POSIX.IO, POSIX.Memory_Mapping;
|
||||
use System.Storage_Elements;
|
||||
|
||||
Text_File : File_Descriptor;
|
||||
Text_Size : System.Storage_Elements.Storage_Offset;
|
||||
Text_Address : System.Address;
|
||||
|
||||
begin
|
||||
Text_File := Open (Name => "read_entire_file.adb",
|
||||
Mode => Read_Only);
|
||||
Text_Size := Storage_Offset (File_Size (Text_File));
|
||||
Text_Address := Map_Memory (Length => Text_Size,
|
||||
Protection => Allow_Read,
|
||||
Mapping => Map_Shared,
|
||||
File => Text_File,
|
||||
Offset => 0);
|
||||
|
||||
declare
|
||||
Text : String (1 .. Natural (Text_Size));
|
||||
for Text'Address use Text_Address;
|
||||
begin
|
||||
Ada.Text_IO.Put (Text);
|
||||
end;
|
||||
|
||||
Unmap_Memory (First => Text_Address,
|
||||
Length => Text_Size);
|
||||
Close (File => Text_File);
|
||||
end Read_Entire_File;
|
||||
Loading…
Add table
Add a link
Reference in a new issue