Reading and writing binary files

Bud Davis
Wed Sep 27 02:57:00 GMT 2006


unformatted in fortran does not mean 'binary' in the
classical sense of the word....

unformatted is a compiler unique format that has a
header and a trailer record that is used to make
movement in the file efficient.  g77 and gfortran use
either a 32 or 64 bit 'record marker' that contains
the size of the record.

both gfortran and g77 have routines for reading a file
a character at a time.  look for fgetc and fputc in
the info pages for either compiler.


More information about the Gcc-help mailing list