Software Archive
Read-only legacy content
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
17066 Discussions

Closed file rewound?

Intel_C_Intel
Employee
447 Views
Suppose I open a file, read a line or two, and then close it. Is that file automatically rewound? In others words, if I open it again later in the same program, will the file be repositioned to the beginning?

Thanks.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
447 Views
Position is a property of the file connection, not the file itself. Once you close the file, the connection goes away. Upon reopening, the position is the default, based on what you specified with POSITION=, if any. Note that the default is 'ASIS', which for Compaq Fortran is the same as 'REWIND'.

Steve
Reply