|
|
1.1 root 1: .TI F77/IO_RANDOM "Sep. 15, 1984"
2: Random Access I/O
3:
4: F77 allows files to be accessed by both sequential and direct (random)
5: access reads and writes.
6: For example, suppose you want
7: to use random access I/O on unit 10 with records that are 20 bytes
8: long.
9: Open unit 10 by:
10:
11: .nf
12: open(10, file='randfile', form='unformatted',
13: . access='direct', recl=20 )
14: .fi
15:
16: Write to it by:
17:
18: .nf
19: real vec(5)
20: ...
21: write(10, rec=n) vec
22: .fi
23:
24: and read from it by:
25:
26: read(10, rec=n) vec
27:
28: where n contains the record number being read or written.
29: The f77 I/O library
30: keeps track of the highest record number written to the file.
31: Any time
32: a write specifies a higher record number, the file is extended.
33: If a
34: read specifies a higher record number, an end-of-file error results.
35: Records not explicitly written contain zeros.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.