|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3072 (0xc00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Files, seg_0046d8
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Io;
with Low_Level_File_Operations;
package body Files is
function Create (From_File : in String) return Iterator is
The_File : Io.File_Type;
New_Iterator : Iterator;
begin
New_Iterator := Lines.Create;
Low_Level_File_Operations.Open_To_Read (From_File, The_File);
while not Io.End_Of_File (The_File) loop
Lines.Add (New_Iterator, Lines.Create (Io.Get_Line (The_File)));
end loop;
Low_Level_File_Operations.Close (The_File);
Lines.Reset_To_First (New_Iterator);
return New_Iterator;
exception
when Low_Level_File_Operations.Io_Failure =>
Low_Level_File_Operations.Close (The_File);
raise Io_Failure;
when others =>
Low_Level_File_Operations.Close (The_File);
raise;
end Create;
procedure Save (To_File : in String; This_Iterator : in out Iterator) is
The_File : Io.File_Type;
begin
Low_Level_File_Operations.Open_To_Write (To_File, The_File);
Lines.Reset_To_First (This_Iterator);
while not Lines.Done (This_Iterator) loop
Io.Put_Line (The_File, Lines.Image (Lines.Current (This_Iterator)));
Lines.Next (This_Iterator);
end loop;
Low_Level_File_Operations.Close (The_File);
exception
when Lines.Not_Initialized =>
Low_Level_File_Operations.Close (The_File);
raise Not_Initialized;
when Low_Level_File_Operations.Io_Failure =>
Low_Level_File_Operations.Close (The_File);
raise Io_Failure;
when others =>
Low_Level_File_Operations.Close (The_File);
raise;
end Save;
end Files;
nblk1=2
nid=0
hdr6=4
[0x00] rec0=22 rec1=00 rec2=01 rec3=018
[0x01] rec0=19 rec1=00 rec2=02 rec3=000
tail 0x217002a34815c672ac7bc 0x42a00088462061e03