Fortran Library Reference

tclose: Write EOF, Close Tape Channel, Disconnect tlu

The function is called by:

INTEGER*4 tclose

n = tclose ( tlu )

tlu

INTEGER*4

Input 

Tape logical unit, in range 0 to 7 

n

INTEGER*4

Return value 

n=0: OK

n<0: Error


Caution - Caution -

tclose() places an EOF marker immediately after the current location of the unit pointer, and then closes the unit. So if you trewin() a unit before you tclose() it, its contents are discarded.


Example: tclose()--close an opened 1/4-inch tape file:


    CHARACTER devnam*9 / '/dev/rst0' /
    INTEGER*4 n / 0 /, tlu / 1 /, tclose, topen
    LOGICAL islabeled / .false. /
    n = topen( tlu, devnam, islabeled )
    n = tclose( tlu )
    IF ( n .LT. 0 ) STOP "tclose: cannot close"
    WRITE(*, '("tclose ok:", 2I3, 1X, A10)')  n, tlu,  devnam
    END

The output is:


tclose ok: 0 1  /dev/rst0