tapeio: topen, tclose, tread, twrite, trewin, tskipf, tstate - FORTRAN
tape device specific I/O routines
integer topen, tclose, tread, twrite, trewin, tskipf, tstate
ierror = topen(tlu, devnam, labled)
ierror = tclose(tlu)
nbytes = tread(tlu, buffer)
nbytes = twrite(tlu, buffer)
ierror = trewin (tlu)
ierror = tskipf (tlu, nfiles, nrecs)
integer fileno, recno, err, eof, eot, tcsr
ierror = tstate (tlu, fileno, recno, err, eof, eot, tcsr)
tapeio is the general name for the set of I/O functions that operate on a
tape device. topen, tclose, trewin, tskipf, and tstate return -1 on
error, 0 if successful. tread and twrite return -1 on error, the number
of bytes read (or written) on success.
topen opens a tape unit for I/O. devnam is the name of the tape device.
labled should be .true. if the tape is labeled. tlu is set to the
logical unit number of the tape device used for subsequent calls.
tclose closes a tape unit previously opened by topen.
tread reads from the tape device into buffer. nbytes is set to the
number of bytes actually read, or -1 for an error. Zero (0) maybe
returned in an end-of-file or end-of-tape situation.
twrite writes to the tape device from buffer. nbytes is set to the
number of bytes actually written, or -1 for an error.
trewin rewinds the tape device.
tskipf skips forward nfiles files and nrecs records.
tstate returns the status of the tape channel. Upon successful
completion, 0 is returned and the following values will be set:
current file number
current record number
err 1 if there are errors, 0 if there are no errors
eof 1 if it is at end-of-file, 0 if not
eot 1 if it is at end-of-tape, 0 if not
tcsr the value of the drive status register, see mt_dsreg in
PPPPaaaaggggeeee 2222 [ Back ]