Yes.
Fortran 2003 introduced streaming language access. Prior to this, most processors supported something equivalent as an extension, possibly called βbinaryβ or similar.
Unformatted stream access does not create record structures in a file. For example, to read data from a file corresponding to a single int in a Companion C processor (if any) for a particular Fortran processor:
USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_INT
INTEGER, PARAMETER :: unit = 10
CHARACTER(*), PARAMETER :: filename = 'name of your file'
INTEGER(C_INT) :: data
!***
OPEN(unit, filename, ACCESS='STREAM', FORM='UNFORMATTED')
READ (unit) data
CLOSE(unit)
PRINT "('data was ',I0)", data
You may have problems with endianess size and data type, but these aspects are language independent.
If you write a language standard before Fortran 2003, then an unformatted read direct access to a suitable integer variable may work - this is a Fortran processor, but it works for many current processors.
source
share