Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Read direct access file in block

Le_Callet__Morgan_M
440 Views

If I know the record length (recl) and number of record(n) i want to read in a file is safe to:

open the file with a record length of recl*n

read the file in block

in other work can I always assume that the data will be sequential and not record delimiter will make this operation unsafe.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
440 Views

Was the file created with RECORDTYPE='FIXED'? If so, then yes you should be able to do this. Keep in mind that, by default, RECL is in units of 4-bytes. You might also want to look at the Fortran standard stream I/O feature that provides a POS= keyword to specify byte position in the file.

0 Kudos
Reply