Hi,
Thanks to all who replied. They are very timely and helpful.
The reason I did not use direct access file is that I prefer to put a few
'header' records at the beginning of the binary file such as number of records,
length of each record. This way the file itself is self-contained.
(the example I gave was a oversimplified one)
Another reason is that once I choose to use sequential access, I never come
back to think about the direct access option.
Thanks to Malcolm Cohen who suggested to use a read with a blank I/O list.
Malcolm believe that this will also skip the record ( the data is not actually
read from the disk). This sounds very likely to be true. If so, this
would be the ideal solution to my problem with a very big record size (million).
Xiaogang
Malcolm Cohen said:
> Clive Page said:
> > Doesn't a read with nothing in it's I/O list perform a skip of one record?
>
> Indeed so, that's why I suggested it!
>
> > If so, this would be better, as there's no possibility of a data type
> > incompatibility.
>
> There is also no possibility of the record being too big or too small
> (for the requested data); READ with no list skips one record whatever size.
------------------------------------------------
Dr Xiaogang Wang
Departement de chimie
Universite de Montreal
C.P. 6128, succursale Centre-ville
Montreal (Quebec) H3C 3J7
Tel. (514) 3436111 ext 3947 (office)
FAX (514) 3437586 (office)
e-mail: [log in to unmask]
homepage: http://www.esi.umontreal.ca/~wangx
------------------------------------------------
|