Paul Suckling wrote:
> I imagine loads of people must have wanted/attempted to do what I did.
I don't want to
> use formatted io, and I was hoping not to have to use direct access
because I know little
> about it and because my records are a lot more complicated that a
single integer and I
> realized it would probably involve a lot of counting/bookwork on my
part. Would that
> be the simplest way to achieve what I was trying though?
Direct access, requiring fixed-length records, is the typical approach.
You can use unformatted I/O for this. Direct access isn't that hard to
deal with - you just keep track of a record number. One thing you do
need to be aware of, if you're using unformatted I/O, is that the
interpretation of RECL= varies among implementations. In some, it is in
units of bytes, in others, it is in units of the size of a default
integer (typically four bytes.) This behavior is usually selectable with
a compile switch. (It is -assume byterecl in Intel compilers.)
Steve Lionel
Software Products Development
Intel Corporation
Nashua, NH
|