HPlogo Using NS 3000/iX Network Services: HP 3000 MPE/iX Computer Systems > Chapter 3 Remote File Access

RFA Programmatic Access

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Once an environment has been established on the remote node, a local application program can access remote files by calling standard MPE/iX file system intrinsics (or by using the input/output procedures specific to the language in which the program is written). If a FILE command specifying a formal designator for a remote file or device has been issued, an FOPEN call in the local program can use this formal designator in its formaldesignator parameter. For example:

   :FILE X=X:NODEB
.
.
>
FOPNE (X,...);

A language-specific I/O procedure can also reference the file by means of this formaldesignator.

In Pascal, the file name used in the program can include the nodespec as follows:

   OPEN (X, 'X:NODEB');

In the Pascal example, the file equation is not needed. Most language-specific file open statements do not permit a nodespec and must use a preceding FILE command.

If a FILE command has not been issued for the remote file, you must specify the location of the file in the FOPEN call, either in the formaldesignator parameter or in the device parameter (not both). (Currently, only in Pascal can you use the extended formal designator, with location, in a non-intrinsic I/O procedure.) These are the two possibilities:

  • formaldesignator: file[/lockword][.group[.account]][:nodespec], where nodespec is an environment ID or $BACK, as defined for a FILE command;

  • device: [envname]#[device], where envname is an 8-character (or shorter) string as defined for a FILE command.

For example:

   FOPEN (X.NODEB,...)
or
FOPEN (X,...,NODEB#,...);

You can also use a file equation to override the location indicated in your program (FILE command parameters override FOPEN parameters). For example, the following sequence opens a file on NODEC:

   :FILE X:NODEB=X:NODEC
.
.
.
FOPEN 9X:NODEB,...):

You can call the MPE/iX FFILEINFO intrinsic to retrieve information about a remote file. In the FFILEINFO intrinsic, ITEM 61 returns the environment ID of a remote file's location — over an NS link. If the file is located on your local system, ITEM 61 returns a blank. The condition codes for the file system intrinsics retain their normal meanings. Network connection errors return a CCL condition code. If such an error occurs, you can call the MPE/iX FCHECK intrinsic to determine the source of the error. File System error codes apply to the remote file. You can also call the MPE/iX PRINTFILEINFO intrinsic to display the status of the remote file.

NOTE: To ensure that the formal designator representing a remote file is syntactically correct, you should always call the FPARSE intrinsic within your program. This intrinsic is documented later in this chapter. For further information on MPE/iX file system intrinsics, including FOPEN, FPARSE, IOWAIT, and IODONTWAIT, see the MPE/iX Intrinsics Reference Manual.
Feedback to webmaster