|
|
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: 11571 (0x2d33)
Types: TextFile
Names: »B«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
└─⟦124ff5788⟧ »DATA«
└─⟦this⟧
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦6d381756c⟧
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
└─⟦6f12a12be⟧ »DATA«
└─⟦6d381756c⟧
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
└─⟦d65440be7⟧ »DATA«
└─⟦6d381756c⟧
└─⟦this⟧
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
└─⟦6f12a12be⟧ »DATA«
└─⟦this⟧
with Text_Io;
with Profile;
with Calendar;
with String_Utilities;
package body Multi_Requests is
Time_Baseline : constant Calendar.Time :=
Calendar.Time_Of (Month => 1, Day => 1, Year => 1970, Seconds => 0.0);
procedure Process_Output
(Text : in String;
Severity : in Profile.Msg_Kind;
State : in out Natural;
Response : in out Remote_Operations.Command_Response) is
Prompt : constant String := "N? ";
begin
Response := Remote_Operations.Nil;
Text_Io.Put (Text);
if Text'Length = 0 then
return;
end if;
if Text (Text'Last) = Ascii.Lf or else Text (Text'Last) = Ascii.Lf then
return;
end if;
if Text'Length < Prompt'Length then
return;
end if;
if String_Utilities.Equal
(Prompt, Text (Text'Last - (Prompt'Length - 1) .. Text'Last),
Ignore_Case => True) then
Response := Remote_Operations.Read_Input;
end if;
end Process_Output;
procedure Read_Input
(State : in out Natural;
Buffer : out String;
Last : out Natural;
Response : in out Remote_Operations.Command_Response) is
begin
Text_Io.Get_Line (Buffer, Last);
if Natural'Succ (Last) in Buffer'Range then
Last := Natural'Succ (Last);
end if;
Buffer (Last) := Ascii.Lf;
Response := Remote_Operations.Nil;
end Read_Input;
procedure Timeout_Handler
(State : in out Natural;
Response : in out Remote_Operations.Command_Response) is
Line : String (1 .. 100);
Last : Natural;
begin
loop
Text_Io.Put
("Timeout expired: (A)bort, (C)ontinue, (R)ead_Input > ");
Text_Io.Get_Line (Line, Last);
if String_Utilities.Equal
(Line (Line'First .. Last), "A", Ignore_Case => True) then
Response := Remote_Operations.Abort_Command;
return;
elsif String_Utilities.Equal
(Line (Line'First .. Last), "C", Ignore_Case => True) then
Response := Remote_Operations.Nil;
return;
elsif String_Utilities.Equal
(Line (Line'First .. Last), "R", Ignore_Case => True) then
Response := Remote_Operations.Read_Input;
return;
end if;
end loop;
end Timeout_Handler;
procedure Remote_Execute is new Remote_Operations.Execution_Generic
(Execution_State => Natural,
Process_Output => Process_Output,
Read_Input => Read_Input,
Timeout_Handler => Timeout_Handler);
procedure Init_Object (Object : in out Object_Id; Machine : in String) is
Errors : Simple_Status.Condition;
begin
Simple_Status.Initialize (Object.Open_Error);
Remote_Operations.Acquire (A_Context => Object.Connection,
Status => Errors,
Machine => Machine,
Instance => "");
end Init_Object;
procedure Disconnect (C : in out Object_Id;
Status : out Simple_Status.Condition) is
begin
Remote_Operations.Release
(A_Context => C.Connection,
Status => Status,
Idle_Timeout => Remote_Operations.Connection_Timeout
(Idle_Time_Out));
end Disconnect;
procedure Shut_Down is
begin
null;
--Connection_Manager.Close_All_Connections;
--Connection_Manager.Shutdown;
end Shut_Down;
procedure Create (Object : in Object_Id;
Remote_File : in String;
Is_Directory : in Boolean := False;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
if Is_Directory then
Remote_Operations.Create_Directory (In_Context => Object.Connection,
With_Name => Remote_File,
Status => S);
else
Remote_Operations.Create_File (In_Context => Object.Connection,
With_Name => Remote_File,
Status => S);
end if;
Status := S;
end Create;
procedure Put (Object : in Object_Id;
From_Local_File : in String;
To_Remote_File : in String;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Put (From_File => From_Local_File,
To_File => To_Remote_File,
In_Context => Object.Connection,
Status => S);
Status := S;
end Put;
procedure Put (Object : in Object_Id;
From_Local_File : in Device_Independent_Io.File_Type;
To_Remote_File : in String;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Put (From_File => From_Local_File,
To_File => To_Remote_File,
In_Context => Object.Connection,
Status => S);
Status := S;
end Put;
procedure Get (Object : in Object_Id;
From_Remote_File : in String;
To_Local_File : in String;
Append_To_File : in Boolean;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Get (From_File => From_Remote_File,
In_Context => Object.Connection,
To_File => To_Local_File,
Status => S,
Append => Append_To_File);
Status := S;
end Get;
procedure Get (Object : in Object_Id;
From_Remote_File : in String;
To_Local_File : in Device_Independent_Io.File_Type;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Get (From_File => From_Remote_File,
In_Context => Object.Connection,
To_File => To_Local_File,
Status => S);
Status := S;
end Get;
procedure Last_Update (Object : in Object_Id;
Of_Remote_File : in String;
In_Seconds : out Integer;
Status : out Simple_Status.Condition) is
The_Time : Calendar.Time;
S : Simple_Status.Condition;
begin
In_Seconds := 0;
Remote_Operations.Update_Time (Of_File => Of_Remote_File,
In_Context => Object.Connection,
Result => The_Time,
Status => S);
In_Seconds := Integer (Calendar."-" (The_Time, Time_Baseline));
Status := S;
end Last_Update;
procedure Copy (Object : in Object_Id;
From_Remote_File : in String;
To_Remote_File : in String;
Link : in Boolean := False;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Copy (From_File => From_Remote_File,
To_File => To_Remote_File,
In_Context => Object.Connection,
Status => S);
Status := S;
end Copy;
procedure Delete (Object : in Object_Id;
Remote_File : in String;
Expunge : in Boolean := False;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Delete_File (In_Context => Object.Connection,
With_Name => Remote_File,
Status => S);
Status := S;
end Delete;
procedure Move (Object : in Object_Id;
From_Remote_File : in String;
To_Remote_File : in String;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
begin
Remote_Operations.Move (From_File => From_Remote_File,
To_File => To_Remote_File,
In_Context => Object.Connection,
Status => S);
Status := S;
end Move;
-- procedure Ls (Object : in Object_Id;
-- From_Remote_Directory : in String;
-- Level : in Natural;
-- To_Local_File : in String;
-- Append_To_File : in Boolean;
-- Status : out Simple_Status.Condition) is
-- S : Simple_Status.Condition;
-- begin
-- Connection_Manager.Operate
-- (Object => Object, Parms => Parameters, Errors => S);
-- Status := S;
-- end Ls;
--
--
-- procedure Ls (Object : in Object_Id;
-- From_Remote_Directory : in String;
-- Level : in Natural;
-- To_Local_File : in Device_Independent_Io.File_Type;
-- Status : out Simple_Status.Condition) is
-- S : Simple_Status.Condition;
-- begin
-- Connection_Manager.Operate
-- (Object => Object, Parms => Parameters, Errors => S);
-- Status := S;
-- end Ls;
procedure Input_To_Remote_Shell (Object : in Object_Id;
Input : in String;
Timeout : in Integer;
Status : out Simple_Status.Condition) is
S : Simple_Status.Condition;
N : Natural := 0;
One_Second : constant Duration := 1.0;
begin
Remote_Execute (Command => Input,
In_Context => Object.Connection,
State => N,
Status => S,
Timeout => Remote_Operations.Command_Timeout
(Timeout * One_Second));
Status := S;
end Input_To_Remote_Shell;
-- procedure Signal_To_Shell (Object : in Object_Id;
-- Signal : in Natural;
-- Status : out Simple_Status.Condition) is
-- Parameters : Operate_Parameters (Request => Signal_To_Shell_R,
-- Local_File_Is_Name => False) :=
-- (Request => Signal_To_Shell_R,
-- Local_File_Is_Name => False,
-- Sts_Signal => Signal);
-- S : Simple_Status.Condition;
-- begin
-- Connection_Manager.Operate
-- (Object => Object, Parms => Parameters, Errors => S);
-- Status := S;
-- end Signal_To_Shell;
end Multi_Requests;