JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Mon Feb 01, 2016 1:22 pm Post subject: |
|
|
mecej4,
Many years ago I wrote a variable length record, random access file library, emulating the library available on 70's CDC Fortran that I used. This is based on the Fortran direct access file, using the fixed length records as buffers for the variable length records. It migrated from FTN IV to F77 and F95.
The library creates a record format structure, like a sequential access binary file, plus an pointer table to the file address of each virtual record.
For what you described, it can be provided by a similar library routine approach.
I have not found the FTN95 rules of direct access a problem. For the problem of record length being discussed, I could open the supplied file for transparent/stream access and create a temporary direct access file of the appropriate fixed record size. The fixed record length is often selected based on a consideration of buffering. After all, you do need some prior knowledge of the structure and position of information in the file. |
|