PATH


8.0

 

The PATH instruction provides a means of retrieving or modifying the current directory path and creating or deleting another directory path. The instruction uses the following format:

 

 

[label]

PATH

{mode}{sep}{path}

 

[label]

PATH

{mode}{sep}{path[|tcpip id:port]}

 

Where:

label

Optional. A Program Execution Label.

mode

Required. One of the following valid PATH modes from the table below.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

path

Required. A previously defined Character String Variable or a string Literal that specifies or receives the path information based upon the mode.

tcpip id:port

Optional. String literal data that contains the IP address and port number of the server executing the Data Manager where the instruction is executed.

Flags Affected: EOS, OVER

Note the following:

  1. The supported modes are:

  2.  

    Mode

    Function

    CURRENT

    Retrieve the current directory path.

    CHANGE

    Change to a different existing directory path.

    CREATE

    Create a new, non-existent directory path.

    DELETE

    Delete an existing directory path.

    EXIST

    Check for existence of specified directory path.

     

  3. If CURRENT is specified and the {path} variable is a null string, the current directory path is transferred to {path} using a MOVE character string to character string technique. If {path} is too small to hold all the directory path information, only those bytes that fit are transferred and the EOS Condition Flag is set.

  4. You may use CURRENT to retrieve the path for your current drive or any other valid drive on your system. If the {path} variable contains a valid drive designator (C:, D:, etc.), the path information for that drive is retrieved. If any other information is in the {path} variable, no path information is moved and the OVER flag is set.

  5. If CHANGE, CREATE, DELETE, or EXIST is specified, the Logical String of {path} is assumed to contain the directory path used for the operation. {path} remains unchanged.

  6. If a CURRENT, CHANGE, CREATE, DELETE, or EXIST operation fails, the OVER Condition Flag is set. The following are examples of why the operation could fail:

  7. CURRENT or CHANGE perform no action when using the PLBCE runtime.

  8. The PATH instruction allows operations at the Sunbelt Data Manager when the DM_ALLOWPATH keyword is enabled in the Data Manager configuration file. If the keyword is not enabled, attempts to use the PATH instruction at the Data Manager will result in an I82 subcode 33 error.

  9. When the {tcpip id:port} address is provided as part of the {path} variable or literal, the instruction is executed at the server where the Data Manager is executing. In this case, the instruction logs on to the Data Manager, performs the operation, and logs off from the Data Manager for a CREATE, DELETE, EXISTS, or CURRENT action.

  10. If the {tcpip id:port} address is used with the PATH CHANGE keyword, the PATH instruction can takes affect at the Data Manager as follows:

  11.  

    A. When the PLB_CURDIR keyword has been specified in the SUNDM CFG file the logical current working directory for the child thread is changed at the Data Manager.

     

    B. If the PLB_CURDIR keyword is not used by the Data Manager, the PATH CHANGE instruction changes the directory for the Data Manager process which affects all clients accessing the Data Manager.

     

    Warning: When the PATH CHANGE instruction is executed, the client program logs on to the Data Manager and remains connected indefinitely. The connection remains active until the program is terminated or until a SETMODE *DMKEEPACTIVE=0 instruction is executed. Please note that a CHAIN instruction does not cause this connection to be disconnected. See the GETMODE and SETMODE *DMKEEPACTIVE description for more information.

  1. The PATH instruction supports Windows Drive Substitution when using the CREATE, CHANGE, DELETE, and EXIST keywords. (9.6)

 

 

See Also: Example Code, SEARCHPATH, System Interface Instructions

 



PL/B Language Reference PARAMTEXT PROFILER