|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 5120 (0x1400)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Text_Io;
separate (List_Package)
procedure Get_List_Of_Files (This_List : out List_Of_File_Names) is
--=============================================================
--=This procedure will get a list of file *names* from the =
--=current input. =
--= =
--=It uses File_Name_Package.Get_Input_File_Name =
--=to do this. Because the file name package does not provide=
--=any way to detect if there are more file names to be read =
--=*before* attempting to read another file name, so we will =
--=*not* be able to tell that we are done reading until the =
--=operation File_Name_Package.Get_Input_File_Name raises =
--=an exception. =
--= =
--=We will read as many file names as are given, storing as =
--=many as will fit in the list and ignoring the rest. If any=
--=are ignored, we will print out a message to that effect. =
--= =
--=Written by GER and b**2 with help from EVB, JM and SG =
--=============================================================
New_List : List_Of_File_Names;
-- a temporary list to hold the new list since This_List is
-- an out parameter
Input_File_Name : File_Name_Package.File_Name;
-- holds a single input file name given to us by the user.
Out_Of_File_Names : Boolean := False;
-- tells if we have no more file names to read.
Too_Many_Files : Boolean := False;
-- Can also be true if we have reached our limit
-- and don't want to read any more files.
begin
-- Get_List_Of_Files (names)
-- Prompt the user for a list of file names
Text_Io.Put_Line ("Enter one or more file names of Ada Program Unit(s)");
Text_Io.Put_Line ("Separate file names with a blank");
Text_Io.Put ("Files:");
--Read in the list of file names
Getting_Of_File_Names:
loop
-- read in all of the file names, saving as many as possible.
-- an error message will be produced if too many are read in.
if New_List.Top_Of_List < New_List.List'Last then
-- it is < because we will increment *before* storing and
-- Top_of_List is initially 0.
-- get one and save it
Get_One:
begin
File_Name_Package.Get_Input_File_Name
(For_This_File => Input_File_Name);
exception
when File_Name_Package.No_More_File_Names =>
Out_Of_File_Names := True;
Text_Io.Skip_Line; -- skip over the End_of_Line that
-- is there
end Get_One;
if not Out_Of_File_Names then
-- need to keep it
New_List.Top_Of_List := New_List.Top_Of_List + 1;
New_List.List (New_List.Top_Of_List) := Input_File_Name;
else
-- out of file names, so nothing to store
null;
end if;
else
-- New_List.Top_Of_List = New_List.List'last and therefore
-- we could have too many file names. If there is another
-- file name out there, i.e. if we don't raise the exception
-- File_Name_Package.No_More_File_Names, then there are too
-- many file names and we must give an error message. After
-- that, we can exit.
Try_One:
begin
File_Name_Package.Get_Input_File_Name
(For_This_File => Input_File_Name);
-- got one, so that makes at least one extra. Now we
-- give them the error message.
Text_Io.Put_Line
("*****Too many file names were input");
Text_Io.Put_Line
("*****Excess file names were ignored");
-- now, skip the rest of the file names.
Text_Io.Skip_Line;
-- we are done reading, so set the exit condition
Too_Many_Files := True;
exception
when File_Name_Package.No_More_File_Names =>
-- no extra files, exactly New_List.List'last.
Text_Io.Skip_Line; -- skip over the end of line
Out_Of_File_Names := True;
end Try_One;
end if;
exit when Out_Of_File_Names or Too_Many_Files;
end loop Getting_Of_File_Names;
This_List := New_List; -- copy the list into the parameter.
end Get_List_Of_Files; --names