DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦6c06f8fc7⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Create_F, package body Create_R, seg_025055

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Communications;
with Files;
with Interchange;
with Mac_Files;
with Mac_Types;
with Mac_Text;
with Osutils;
with Rational_Error;
with Talk_Utils;
with Text_Io;
use Text_Io;
package body Create_R is

    package Create_F is

        procedure Is_Directory_In (Is_A_Directory : Boolean);
        procedure Create_Directories_In (Create_Them : Boolean);
        procedure Remote_File_In (Name : Mac_Text.Text);
        procedure Options_In (Options : Mac_Text.Text);
        procedure End_Create;

    end Create_F;

    package body Create_F is  
        Err : Mac_Types.Oserr := Mac_Types.Noerr;
        Is_Directory : Boolean;
        Create_Directories : Boolean;

        procedure Is_Directory_In (Is_A_Directory : Boolean) is  
        begin
            Err := Mac_Types.Noerr;
            Create_Directories := True;
            Is_Directory := Is_A_Directory;
        end Is_Directory_In;

        procedure Create_Directories_In (Create_Them : Boolean) is
        begin
            Create_Directories := Create_Them;
        end Create_Directories_In;

        procedure Remote_File_In (Name : Mac_Text.Text) is
        begin
            if Create_Directories then
                Err := Mac_Files.Create_Sub_Directories (Name);
                if Err /= Mac_Types.Noerr then
                    return;  
                end if;  
                if Is_Directory then
                    Err := Mac_Files.Create_Directory (Name);
                else
                    Err := Mac_Files.Create_File (Name);
                end if;
            end if;
        end Remote_File_In;

        procedure Options_In (Options : Mac_Text.Text) is
        begin
            null;
        end Options_In;

        procedure End_Create is
        begin
            if Err /= Mac_Types.Noerr then
                Rational_Error.Raise_Mac_Error (Err);
            end if;
        end End_Create;
    end Create_F;

    procedure Read (A_Connection : in out Communications.Connection) is
        I : Mac_Types.Longint;
        B : Boolean;
        T : Mac_Text.Text (256);
    begin
        Put_Line ("create_r:read begin");
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Is_Directory then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Bool (A_Connection, B);
        Create_F.Is_Directory_In (B);
        Put ("create_r:is directory: ");
        Put_Line (Boolean'Image (B));
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Create_Dir then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Bool (A_Connection, B);
        Create_F.Create_Directories_In (B);
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Remote_File then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Text (A_Connection, T);
        Create_F.Remote_File_In (T);
        Put ("create_r: file '");
        for I in 1 .. Mac_Text.Length (T) loop
            Put (Character'Val (Mac_Types.Char'Pos (Mac_Text.Value (I, T))));
        end loop;
        Put_Line ("'");
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Options then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Text (A_Connection, T);
        Create_F.Options_In (T);
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Delimitor then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.R_Create then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Put_Line ("create_r:read end");
    end Read;

    procedure Write (A_Connection : in out Communications.Connection) is
    begin
        Put_Line ("create_r:write begin");
        begin
            Create_F.End_Create;
        exception
            when others =>
                Rational_Error.Report
                   (A_Connection, Talk_Utils.R_Create, Rational_Error.Get);
        end;
        Interchange.Put_Int (A_Connection, Talk_Utils.F_Delimitor);
        Interchange.Put_Int (A_Connection, Talk_Utils.R_Create);
        Put_Line ("create_r:write end");
    end Write;

end Create_R;

E3 Meta Data

    nblk1=7
    nid=6
    hdr6=c
        [0x00] rec0=25 rec1=00 rec2=01 rec3=058
        [0x01] rec0=1f rec1=00 rec2=07 rec3=008
        [0x02] rec0=18 rec1=00 rec2=02 rec3=042
        [0x03] rec0=00 rec1=00 rec2=03 rec3=014
        [0x04] rec0=17 rec1=00 rec2=05 rec3=036
        [0x05] rec0=13 rec1=00 rec2=04 rec3=000
        [0x06] rec0=72 rec1=d8 rec2=00 rec3=002
    tail 0x2172003f2839f49baede5 0x42a00088462060003
Free Block Chain:
  0x6: 0000  00 00 03 fc 80 3b 65 20 52 65 61 64 20 28 41 5f  ┆     ;e Read (A_┆