Emoslib is now deprecated

A subroutine which can be called from FORTRAN to read a block of bytes from an unblocked binary file. The return status code must be checked after calling the subroutine. (Note that this routine behaves differently from PBREAD2 on hitting end-of-file.)

The format and arguments for the subroutine are:

      SUBROUTINE PBREAD( KUNIT, KARRAY, KOUNT, KRET)

Input parameters are INTEGERs.

 

PBREAD input arguments
KUNITIndex of a C file pointer obtained from PBOPEN
KOUNTThe number of BYTES to read from the file

Output parameters are INTEGERs.

 

PBREAD output arguments
KARRAYAn integer array to accept the bytes read
KRET
Status return code:
 >= 0, number of bytes read from the file
   -1, end-of-file is hit before the requested number of bytes has been read
   -2, error in reading the file