Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclcdb!cdb
From: cdb@hpclcdb.HP.COM (Carl Burch)
Newsgroups: comp.lang.fortran
Subject: Fortran File Formats Survey
Message-ID: <6690019@hpclcdb.HP.COM>
Date: 6 Jul 88 21:52:00 GMT
Organization: HP ITG/ISO Computer Language Lab
Lines: 38


     On systems like UN*X and MS-DOS with byte-stream file systems, the 
Fortran I/O library has to impose a data file format to support Fortran's 
record-oriented file model.  On HP-UX, these take the following forms :

Sequential Formatted file format :
     ASCII files delimited with the newline character (ACSII 10 decimal).

Sequential Unformatted file format :
     Binary data preceded and followed by four bytes holding the record 
     length (in bytes).  The "green word" at the end is necessary to 
     BACKSPACE the file correctly.

Direct Formatted file format :
     ASCII fixed-length records not physically separated.  Unwritten 
     bytes in the record are padded with blanks.

Direct Unformatted file format :
     Binary fixed-length records not physically separated.  Unwritten 
     bytes in the record are padded with zero bytes (ASCII Nulls).

     Bell's f77(1) compiler uses this scheme as well.

     On MS-DOS, (at least my copy of) Microsoft Fortran uses the above 
formats except that Direct Unformatted files are also padded with blanks 
and the Sequential Unformatted format uses only a one-byte "green word" to 
hold the length of each record. In the latter case, there is an escape 
value saying that the following record is full to the max (256?) and there 
will be following records.

     Given this much similarity, I wonder if we may have a de facto standard 
evolving here.  If we could do something about the data format in binary
files (e.g., the IEEE floating point format), it might be possible to use
systems like NFS considerably more transparently than currently possible.

    I'd like examples of other byte-stream file systems' Fortran compilers'
solutions to this problem.  Are they as similar as those around my shop?

							Carl Burch