Programmer Guide > Working with Data Files > UNIX-Specific Information
  

UNIX-Specific Information
UNIX offers only a single type of file. All files are considered to be an uninterrupted stream of bytes, and there is no such thing as record structure at the operating system level. (By convention, records of text are simply terminated by the linefeed character, which is referred to as “newline”.) It is possible to move the current file pointer to any arbitrary position in the file and to begin reading or writing data at that point. This simplicity and generality forms a system in which any type of file can be manipulated easily, using a small set of file operations.
Reading FORTRAN-Generated Binary Data
Although the UNIX operating system views all files as an uninterrupted stream of bytes, FORTRAN considers all I/O to be done in terms of logical records. In order to reconcile FORTRAN’s need for logical records with UNIX files, UNIX FORTRAN programs add a longword count before and after each logical record of data. These longwords contain an integer count giving the number of bytes in that record.
The use of the F77_ Unformatted keyword with the OPENR statement informs PV-WAVE that the file contains binary data produced by a UNIX FORTRAN program. When a file is opened with this keyword, PV-WAVE interprets the longword counts properly, and is able to read and write files that are compatible with FORTRAN. To see an example showing the use of the F77_ Unformatted keyword with the OPENR statement, refer to "Reading UNIX FORTRAN-Generated Binary Data".

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.