DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦29021a4ab⟧ TextFile

    Length: 14872 (0x3a18)
    Types: TextFile
    Names: »V«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦12c68c704⟧ 
                └─⟦this⟧ 
└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦220843204⟧ 
                └─⟦this⟧ 

TextFile

with Ftp_Defs;
with Transport_Defs;
with Machine;

package File_Transfer is

    pragma Subsystem (Ftp_Interface, Private_Part => Closed);
    pragma Module_Name (4, 4005);

    type Connect_Id is private;

    --- handle for all communications to ftp transfer service


    Socket_21          : constant                          := 21;
    Default_Ftp_Socket : constant Transport_Defs.Socket_Id :=
       (1 => 0, 2 => Socket_21);


    procedure Open (Connection : out Connect_Id;
                    Status     : out Transport_Defs.Status_Code);

    ---- allocate a connection and initialize it;
    ---- May fail due to resource limitations and/or networking
    ---- problems


    procedure Close (Connection : Connect_Id);

    ---- Release connection.
    ---- Returned to pool for others requesters

    procedure Get_Owner (Connection : Connect_Id; Owner : out Machine.Job_Id);

    ---- return the current owner of the connection

    procedure Set_Owner (Connection : in Connect_Id; Owner : Machine.Job_Id);
    ---- change the owner of the connection

    ---- Connection with FTP have knowledge of the job which opened
    ---- the connect.  It detects the death of the job and reclaims the
    ---- resources.  If a user wishes to pass the connect_id between
    ---- jobs and have it be used then it should update the owner
    ---- the the jobs or a job which will be running the full time
    ---- the connection is in use.



    procedure Connect (Connection     : Connect_Id;
                       To_Remote_Host : Transport_Defs.Host_Id;
                       Remote_Socket  : Transport_Defs.Socket_Id :=
                          Default_Ftp_Socket);

    ---- Initiate a connection to the host and socket specified
    ---- The outcome of this operations is checked by using the
    ---- COMMAND_STATUS and READ_RESPONSE procedures


    procedure Disconnect (Connection : Connect_Id);

    ---- Break the current Ethernet connection
    ---- Used in case of a problem otherwise the SEND_QUIT command
    ---- should be sent.


    procedure Read_Response (Connection :     Connect_Id;
                             Message    : out String;
                             Count      : out Natural);

    ---- Return the text messages recieved from the FTP server.  The
    ---- messages will still contain the code values found at the start of
    ---- the messages.  The messages are line oriented.  Count is the number
    ---- of characters in the message.
    ---- Read_response will block waiting for the next message or
    ---- the end of the command.
    ----    Note: A string length of 80 or more
    ---- is recommended to get full lines of the message;
    ---- If no command is active then a message of length zero is returned

    function End_Of_Line (Connection : Connect_Id) return Boolean;

    ---- Returns true when the end of a given message line is reached.
    ---- If no command is active and the fucntion is called true
    ---- is returned.

    function End_Of_Response (Connection : Connect_Id) return Boolean;

    ---- When all response messages for a FTP request have been read
    ---- END_OF_RESPONSE  will be TRUE.  If no command is active and
    ---- the function is called True is again returned.

    procedure Command_Status (Connection :     Connect_Id;
                              Status     : out Ftp_Defs.Status_Code);

    ---- Return the final status of the last operation performed.
    ---- If COMMAND_STATUS is called before all responses have been
    ---- read they will be discarded.

    procedure File_Transfer_Status (Connection :     Connect_Id;
                                    Status     : out Ftp_Defs.Transfer_Status);

    ---- Return status the current status of the most recent
    ---- file transfer


    procedure Send_Username (Connection : Connect_Id; Username : String);

    ---- Send username information to the FTP server.
    ---- The command should be the first command issued after a successful
    ---- connect.  (ie REQUEST_STATUS returns a status of successful);


    procedure Send_Password (Connection : Connect_Id; Password : String);

    ---- Send the password associated with the username previously sent.
    ---- A command status of NEED_PASSWORD returned after the user command
    ---- denotes the the password information is needed.

    procedure Send_Account (Connection : Connect_Id; Account : String);

    ---- Some FTP servers require Account information for some file
    ---- operations.


    procedure Send_Quit (Connection : Connect_Id);

    ---- Send to command to the server informing it that the session is
    ---- logging off. This will cause the connection to be disconnected.


    procedure Set_Type (Connection : Connect_Id; New_Type : Ftp_Defs.Type_Code);

    ---- Send request for transfer type setting to be change to
    ---- specified value.  First the local server checks to see that
    ---- it supports the TYPE if it does the request is sent.  If a
    ---- positive response is recieved then the local setting is updated.


    procedure Set_Mode (Connection : Connect_Id; New_Mode : Ftp_Defs.Mode_Code);

    ---- Send request for transfer mode setting to be change to
    ---- specified value.  First the local server checks to see that
    ---- it supports the MODE if it does the request is sent.  If a
    ---- positive response is recieved then the local setting is updated.

    procedure Set_Structure (Connection    : Connect_Id;
                             New_Structure : Ftp_Defs.Structure_Code);

    ---- Send request for transfer mode setting to be change to
    ---- specified value.  First the local server checks to see that
    ---- it supports the MODE if it does the request is sent.  If a
    ---- positive response is recieved then the local setting is updated.


    procedure Set_Allocation
                 (Connection : Connect_Id; Pages : Natural; Records : Natural);

    ---- Some machines will require that space be preallocated to transfer
    ---- data.


    procedure Send_Delete (Connection : Connect_Id; Remote_Filename : String);

    ---- Send command across link requesting the remote machine to
    ---- delete the named file.

    procedure Send_Cwd (Connection : Connect_Id; Remote_Pathname : String);

    ---- Send command across link requesting the remote machine to
    ---- update its current working directory to the pathname specified


    function Pio_File_Of (Connection : Connect_Id) return Ftp_Defs.Pio_Pointer;

    function Dio_File_Of (Connection : Connect_Id) return Ftp_Defs.Dio_Pointer;

    ---- Return to pointer for the files used by FTP.  The FTP
    ---- transfer routines handle control of the file handle for the
    ---- local files.  The functions above give the user visibility to
    ---- these handles so that their program can also work with the
    ---- file without having to pass the name around.


    procedure Start_Store (Connection      : Connect_Id;
                           Remote_Filename : String;
                           Append          : Boolean := False);

    ---- Start the process for sending a file across the network data link
    ---- This form assumes the user has already opened the file for reading
    ---- (Using either poly_io for binary transfers or device_independent_io
    ---- for character and byte transfers) on the file_pointers supplied by
    ---- the pio_of
    ---- Append specifies that the data sent is to be appened to the
    ---- contents of the remote file if it exist.

    procedure Start_Store (Connection      : Connect_Id;
                           Local_Filename  : String;
                           Remote_Filename : String;
                           Append          : Boolean := False);

    ---- Similiar to the previous store, only this version opens the file
    ---- for the user using the name supplied in local_filename.
    ---- the current transfer type setting (binary,ascii ...etc) determines
    ---- which type of open will be used.


    procedure Start_Retrieve (Connection      : Connect_Id;
                              Remote_Filename : String);

    ---- Request that the remote server send a copy of the file specified
    ---- by remote_filename be sent across the data connect and placed
    ---- in the local file which the use has opened using the appropriate
    ---- open operations with the file handle made visible by the functions
    ---- above

    procedure Start_Retrieve (Connection      : Connect_Id;
                              Local_Filename  : String;
                              Remote_Filename : String;
                              Append          : Boolean := False);

    ---- Request that the remote server send a copy of the file specified
    ---- by remote_filename be sent across the data connect and placed
    ---- in the local file.  The local file is opened be the FTP transfer
    ---- worker using the local_filename supplied by the user.
    ---- Append specifies that the data transfered is to be appended to
    ---- the contents of the local file.

    procedure Start_Directory_List (Connection      : Connect_Id;
                                    Remote_Pathname : String;
                                    Verbose         : Boolean := False);

    ---- Request that the remote server send directory/file information
    ---- for the directory/file specified by remote_pathname.
    ---- The list is placed in the local file which the user has
    ---- opened via the dio_file_of.
    ---- The parameter verbose if true specifies is list of files and
    ---- file information is to be sent.  If verbose is false only a
    ---- list of filename matching the remote_pathname is sent.

    procedure Start_Directory_List (Connection      : Connect_Id;
                                    Local_Filename  : String;
                                    Remote_Pathname : String;
                                    Verbose         : Boolean := False);

    ---- Request that the remote server send directory/file information
    ---- for the directory/file specified by remote_pathname.
    ---- The list is placed in the local_filename.
    ---- The parameter verbose if true specifies is list of files and
    ---- file information is to be sent.  If verbose is false only a
    ---- list of filename matching the remote_pathname is sent.

    procedure Send_Data_Port (Connection : Connect_Id;
                              Host       : Transport_Defs.Host_Id;
                              Socket     : Transport_Defs.Socket_Id);

    ---- Send information to the FTP server telling it what port
    ---- it should be sending the data it transfers to.

    function Data_Host_Id (Connection : Connect_Id)
                          return Transport_Defs.Host_Id;

    function Data_Socket_Id (Connection : Connect_Id)
                            return Transport_Defs.Socket_Id;

    ---- Returns the host and socket id for that data connect being used
    ---- on the current connection.  These should be used to get
    ---- the information to be sent in the SEND_DATA_PORT command

    procedure Send_Help_Request
                 (Connection : Connect_Id; Help_On : String := "");

    ---- Request the remote ftp server to return help information cross the
    ---- command link.  The response is read as usual with the read_response
    ---- procedure.

    procedure Send_Status_Request
                 (Connection : Connect_Id; Status_On : String := "");

    ---- Request the remote ftp server to return status information for
    ---- the specified argument.  For the null argument the server should
    ---- send back general status.  A none null argument the server will
    ---- try to send back file/directory information for the specified
    ---- argument.


    procedure Send_Verbatim (Connection : Connect_Id; Command : String);

    ---- Send the arguement COMMAND across the command connect unchanged.
    ---- This comand must be a simple command which has no side affects,
    ---- such as causing the server to try to transfer a file.


    procedure Send_Site_Command (Connection : Connect_Id; Argument : String);

    ---- Some servers have site specific options.  Allow user
    ---- to send site command. The local server will register positive
    ---- or negative completion but as in the SEND_VERBATIM command
    ---- no local processing from the response occurs. (ie. local parameters
    ---- remain unchanged.

    procedure Send_Pasv (Connection : Connect_Id);

    ---- Request remote to go into pasv mode on its data connect
    ---- Remote will return identity of this port and this information
    ---- the local server will attempt to read this information and
    ---- it is queried using functions PASV_DATA_HOST and PASV_DATA_SOCKET
    ---- Since the response varies betweenimplementations the
    ---- local server may not be able to interpret the response.
    ---- It may be necessary for the user to visually inspect the
    ---- response.

    function Pasv_Data_Host (Connection : Connect_Id)
                            return Transport_Defs.Host_Id;

    function Pasv_Data_Socket (Connection : Connect_Id)
                              return Transport_Defs.Socket_Id;

    --- host and socket information for last SEND_PASV request
    --- if the response could not be parsed TRANSPORT_DEFS.NULL_HOST_ID,
    --- and TRANSPORT_DEFS.NULL_SOCKET_ID will be returned.


    function Is_Open (Connection : Connect_Id) return Boolean;

    function Is_Connected (Connection : Connect_Id) return Boolean;

    function Is_Logged_In (Connection : Connect_Id) return Boolean;

    function Current_Type (Connection : Connect_Id) return Ftp_Defs.Type_Code;

    function Current_Mode (Connection : Connect_Id) return Ftp_Defs.Mode_Code;

    function Current_Structure (Connection : Connect_Id)
                               return Ftp_Defs.Structure_Code;

    function Command_Is_Active (Connection : Connect_Id) return Boolean;

    function Most_Recent_Command (Connection : Connect_Id)
                                 return Ftp_Defs.Ftp_Commands;

    function Most_Recent_Command_Status
                (Connection : Connect_Id) return Ftp_Defs.Status_Code;

    function Most_Recent_Response_Code (Connection : Connect_Id) return Natural;

    function Transfer_Is_Active (Connection : Connect_Id) return Boolean;

    function Most_Recent_Transfer_Status
                (Connection : Connect_Id) return Ftp_Defs.Transfer_Status;

    function Last_Transfer_Length (Connection : Connect_Id) return Natural;

    function Last_Transfer_Time (Connection : Connect_Id) return Duration;

    function Remote_Host_Id (Connection : Connect_Id)
                            return Transport_Defs.Host_Id;

    Null_Connect_Id : constant Connect_Id;

end File_Transfer;