next up previous contents index
Next: Routines to perform Up: FORTRAN callable interface Previous: Routines to convert

Routines to transfer files

N.B. for all of the following routines, a connection must first be established using CZOPEN (see on Page gif). All of the following routines return:

IRC < 0 : error - explanatory message will be printed by routine
IRC = 0 : success : see statistics in IQUEST
IRC = 1 : cannot open remote file
IRC = 2 : cannot open local  file
IRC = 3 : problem in file transfer

For IRC = 0:

IQUEST(11) = Number of records transferred
IQUEST(12) = Number of kilobytes transferred
IQUEST(13) = Transfer rate in KB/second
IQUEST(14) = Number of hours elapsed (real time)
IQUEST(15) = Number of minutes elapsed (real time)
IQUEST(16) = Number of seconds elapsed (real time)
IQUEST(17) = Number of seconds elapsed (CPU time)

N.B. file names for VM/CMS systems should be specified in the form filename.filetype .filemode , e.g. PROFILE.EXEC.A. VM mini-disks should be specified in the form username .address ,e.g. JAMIE , PUBWS.197 . File transfer to and from VM/CMS systems and access to files stored in VM/CMS systems is only possible to the current 'A-disk', which can be changed using the XZCD routine (see on Page gif).

Get text file

CALL XZGETA (LOCAL,REMOTE,CHOPT,IRC)

LOCAL
Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
CHOPT
Character variable to specify the options desired.
IRC
Integer vriable in which the return code is returned.

This routine gets a text file from the remote system. If option 'S' is specified, statistics on the file transfer are printed. If option 'V' is specified, the local file will have variable length record format (IBM-VM systems only).

Example of using the XZGETA routine

      CALL XZGETA('=','CZPACK.CARDS','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send text file

CALL XZPUTA (LOCAL,REMOTE,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends a text file to the remote system. If option 'S' is specified, statistics on the file transfer are printed. If option 'V' is specified, the remote file will have variable length record format (IBM-VM systems only).

Example of using the XZPUTA routine

      CALL XZPUTA('CZPACK.CARDS','=','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Get binary file: fixed length records

CALL XZGETB (LOCAL,REMOTE,LRECL,CHOPT,IRC)

LOCAL

Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
LRECL
Integer variable specifying the record length of the file in bytes.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine gets a binary file from the remote system. The file must have fixed length records. ZEBRA FZ files in binary exchange format, PATCHY CETA files and EPIO files are examples of files that can be transferred with this routine. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZGETB routine

      CALL XZGETB('FXFILE.DAT','FXFILE.VAX',32400,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send binary file: fixed length records

CALL XZPUTB (LOCAL,REMOTE,LRECL,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
LRECL
Integer variable specifying the record length of the file in bytes.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends a binary file to the remote system. The file must have fixed length records. ZEBRA FZ files in binary exchange format, PATCHY CETA files and EPIO files are examples of files that can be transferred with this routine. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZPUTB routine

      CALL XZPUTB('CZPACK.CETA','=',3600,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Get FORTRAN direct access file

CALL XZGETD (LOCAL,REMOTE,LRECL,CHOPT,IRC)

LOCAL
Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
LRECL
Integer variable specifying the record length of the file in bytes.
CHOPT
Characer variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine gets a direct access file from the remote system. ZEBRA FZ files in binary exchange format written with option D, ZEBRA RZ files (between like machines) are examples of files that can be transferred with this routine. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZGETD routine

      CALL XZGETD('FXFILE.DAT','FXFILE.VAX',32400,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send FORTRAN direct access file

CALL XZPUTD (LOCAL,REMOTE,LRECL,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
LRECL
Integer variable specifying the record length of the file in bytes.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends a direct access file to the remote system. ZEBRA FZ files in binary exchange format written with option D, ZEBRA RZ files (between like machines) are examples of files that can be transferred with this routine. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZPUTD routine

      CALL XZPUTD('FXFILE.DATA','=',32400,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Get binary PAM file

CALL XZGETP (LOCAL,REMOTE,CHOPT,IRC)

LOCAL
Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine gets a binary PAM file from the remote system. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZGETP routine

      CALL XZGETP('=','ZEBRA.PAM','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send binary PAM file

CALL XZPUTP (LOCAL,REMOTE,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends a binary PAM file to the remote system. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZPUTP routine

      CALL XZPUTP('KERNAPO.PAM','/cern/new/pam/kernapo/pam','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Get ZEBRA FZ file

CALL XZGETF (LOCAL,REMOTE,LRECL,LFORM,RRECL,RFORM,CHOPT,IRC)

LOCAL
Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
LRECL
Integer variable specifying the record length of the local file in bytes.
LFORM
Character variable specifying the format of the local file.
RRECL
Integer variable specifying the record length of the remote file in bytes.
RFORM
Character variable specifying the format of the remote file.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine gets a binary file from the remote system. If the local file format or record length are not given, they default to the same values as on the remote system. The format may be 'A', for FZ exchange, ASCII mapping, 'X', for FZ exchange, binary, or ' ' for FZ native. For ASCII files the record length defaults to 80 bytes. For binary exchange format files, the record length is taken from the file itself. For native format files the record length must be specified. For binary exchange format files, a 'D' may also be specified, indicating that the file should be processed using direct-access I/O. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZGETB routine

*
*     Transfer a remote ASCII exhange format file to a local
*     binary exchange format file
*
      CALL XZGETF('FXFILE.DAT','FXFILE.VAX',80,'A',32400,'X','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send ZEBRA FZ file

CALL XZPUTF (LOCAL,REMOTE,LRECL,LFORM,RRECL,RFORM,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
LRECL
Integer variable specifying the record length of the local file in bytes.
LFORM
Character variable specifying the format of the local file.
RRECL
Integer variable specifying the record length of the remote file in bytes.
RFORM
Character variable specifying the format of the remote file.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends a ZEBRA FZ file to the remote system. If the remote file format or record length are not given, they default to the same values as on the local system. The format may be 'A', for FZ exchange, ASCII mapping, 'X', for FZ exchange, binary, or ' ' for FZ native. For ASCII files the record length defaults to 80 bytes. For binary exchange format files, the record length is taken from the file itself. For native format files the record length must be specified. For binary exchange format files, a 'D' may also be specified, indicating that the file should be processed using direct-access I/O. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZPUTF routine

*
*     Transfer the local exchange format file to a remote native
*     format file
*
      CALL XZPUTF('FZFILE.DATA','=',32400,'X',32400,' ','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Get RZ file

CALL XZGETR (LOCAL,REMOTE,CHOPT,IRC)

LOCAL
Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine gets a ZEBRA RZ file from the remote system. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZGETR routine

      CALL XZGETR('=','HBOOK.CMZ','S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send ZEBRA RZ file

CALL XZPUTR (LOCAL,REMOTE,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends a ZEBRA RZ file to the remote system. ZEBRA RZ files include HBOOK histogram files, ntuples, CMZ files etc. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZPUTR routine

      CALL XZPUTR('FPACK.CMZ','=,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Get exchange format file

CALL XZGETX (LOCAL,REMOTE,LRECL,CHOPT,IRC)

LOCAL
Character variable specifying the local file name. If LOCAL = '=', then the file on the local system will have the same name as on the remote system.
REMOTE
Character variable specifying the remote file name.
LRECL
Integer variable specifying the record length of the file in bytes.
CHOPT
Characer variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine retrieves an exchange format file from the remote system. An exchange format file is one with fixed length records and no control words. The XZGETX routine uses Fortran sequential I/O on all systems except Unix, where files are processed with direct access I/O to avoid the control words that are written at the beginning and end of each record with binary sequential Fortran I/O. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZGETX routine

      CALL XZGETX('FXFILE.DAT','FXFILE.VAX',32400,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'

Send exchange format file

CALL XZPUTX (LOCAL,REMOTE,LRECL,CHOPT,IRC)

LOCAL
Character variable specifying the local file name.
REMOTE
Character variable specifying the remote file name. If REMOTE = '=', then the file on the remote system will have the same name as on the local system.
LRECL
Integer variable specifying the record length of the file in bytes.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine sends an exchange format file to the remote system. An exchange format file is one with fixed length records and no control words. The XZPUTX routine uses Fortran sequential I/O on all systems except Unix, where files are processed with direct access I/O to avoid the control words that are written at the beginning and end of each record with binary sequential Fortran I/O. If option 'S' is specified, statistics on the file transfer are printed.

Example of using the XZPUTX routine

      CALL XZPUTX('FXFILE.DATA','=',32400,'S',IRC)
      IF(IRC.NE.0) PRINT *,'File transfer failed'



next up previous contents index
Next: Routines to perform Up: FORTRAN callable interface Previous: Routines to convert


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