next up previous contents index
Next: General utility routines Up: FORTRAN callable interface Previous: Routines to transfer

Routines to perform remote I/O

Open remote file

CALL XZOPEN (LUN,FILE,NODE,LRECL,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
FILE
Character variable specifying the remote file name.
NODE
Characer variable specifying the remote node name.
LRECL
Integer ariable specifying the record length in bytes.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine opens a file on the specified node. If a connection to the remote system is not yet established, a call to CZOPEN is made automatically. The record length is currently only required for direct access files.

CHOPT: 'D' - Open the file for direct access (default=sequential)
CHOPT: 'F' - Open the file 'FORMATTED' (default=unformatted)
CHOPT: 'N' - Open the file with STATUS='NEW' (default=unknown)

Example of using the XZOPEN routine

      CALL XZOPEN(11,'/user/jamie/cspack/cspack.ceta',3600,' ',IRC)
      IF(IRC.NE.0) PRINT *,'Cannot open remote file'

Close remote file

CALL XZCLOS (LUN,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine closes a remote file previously opened by XZOPEN.

CHOPT: 'D' - Delete remote file

Example of using the XZCLOS routine

      CALL XZCLOS(11,' ',IRC)
      IF(IRC.NE.0) PRINT *,'Error closing remote file'

Open a remote RZ file

CALL XZRZOP (LUN,NODE,CHFILE,CHOPT,LRECL,IRC)

LUN
Integer variable specifying logical unit to be used.
NODE
Characer variable specifying the remote node name.
CHFILE
Character variable specifying the remote file name.
CHOPT
Character variable to specify the options desired.
LRECL
Integer ariable specifying the record length in bytes.
IRC
Integer variable in which the return code is returned.
Use the XZROPN to open a remote RZ file. See the description of the RZOPEN routine in the Zebra manual for more details.

Read record from remote file

CALL XZREAD (LUN,IBUFF,NREC,NWANT,NGOT,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
IBUFF
Array to receive the data.
NREC
Integer variable specifying the record number to read (for direct access files only).
NWANT
Integer variable specifying the number of bytes to read (for files with variable length records NWANT specifies the maximum number of bytes that can be accepted).
NGOT
Integer variable specifying the number of bytes read for files with variable length records.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine reads a record from a remote file previously opened by XZOPEN.

Example of using the XZREAD routine

      CALL XZREAD(11,IBUFF,0,32400,NGOT,' ',IRC)
      IF(IRC.NE.0) PRINT *,'Error reading remote file'

Write record to remote file

CALL XZRITE (LUN,IBUFF,NREC,NWRITE,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
IBUFF
Array to containing the data to be written.
NREC
Integer variable specifying the record number to write (for direct access files only).
NWRITE
Integer variable specifying the number of bytes to write. for files with variable length records.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine writes a record from a remote file previously opened by XZOPEN.

Example of using the XZRITE routine

      NREC    = 30
      LENBUFF = 8192
      CALL XZRITE(11,IBUFF,NREC,32400,LENBUFF,' ',IRC)
      IF(IRC.NE.0) PRINT *,'Error writing to remote file'

Read a line from a remote file

CALL XZGETL (LUN,CHLINE,CHFORM,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
CHLINE
Character variable to receive the line
CHFORM
Character variable specifying the format to be used for reading the line
CHOPT
Character variable specifying the options required
IRC
Integer variable in which the return code is returned.
This routine reads a record from a remote formatted file previously opened with the XZOPEN routine.

Example of using the XZGETL routine

         CALL XZGETL(LUFZFA,CHLINE,'(A)',' ',IRC)
         IF(IRC.NE.0) GOTO 20

Write a line to a remote file

CALL XZPUTL (LUN,CHLINE,CHFORM,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
CHLINE
Character variable containing the data to be written
CHFORM
Character variable specifying the format to be used for writing the line
CHOPT
Character variable specifying the options required
IRC
Integer variable in which the return code is returned.
This routine writes a record to a remote formatted file previously opened with the XZOPEN routine.

Example of using the XZPUTL routine

         CALL XZPUTL(LUFZFA,CHLINE,'(A)',' ',IRC)
         IF(IRC.NE.0) GOTO 20

Rewind remote file

CALL XZREWD (LUN,CHOPT,IRC)

LUN
Integer variable specifying logical unit to be used.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine rewinds a remote file previously opened by XZOPEN.

Example of using the XZREWD routine

      CALL XZREWD(11,' ',IRC)
      IF(IRC.NE.0) PRINT *,'Error rewinding to remote file'

Inquire if remote file exists

CALL XZINQR (LUN,FILE,NODE,IEXIST,LRECL,IRC)

LUN
Integer variable specifying logical unit to be used.
FILE
Character variable specifying the remote file name.
NODE
Character variable specifying the node on which the file resides
IEXIST
Integer variable in which the remote file status is returned.
LRECL
Integer variable in which the record length of the remote file status is returned.
IRC
Integer variable in which the return code is returned.

This routine checks whether a remote file exists or is OPENed.

Example of using the XZINQR routine

      CALL XZINQR(11,'DISK$CERN:<JAMIE>ZEBRA.PAM',
     +   'VXCRNA',IEXIST,LRECL,IRC)
      IF(IRC.NE.0) PRINT *,'Error issuing remote inquire'



next up previous contents index
Next: General utility routines Up: FORTRAN callable interface Previous: Routines to transfer


Janne Saarela
Tue May 16 09:22:05 METDST 1995