XL Fortran for AIX 8.1

User's Guide


File Positioning


Table 21. Position of the File Pointer When a File Is Opened with No POSITION= Specifier

-qposition suboptions Implicit OPEN Explicit OPEN
STATUS = 'NEW' STATUS = 'OLD' STATUS = 'UNKNOWN'
File exists File does not exist File exists File does not exist File exists File does not exist File exists File does not exist
option not specified Start Start Error Start Start (1), (3) Error Start Start
appendold (2) Start Start Error Start End Error Start Start
appendunknown Start Start Error Start Start (3) Error End Start
appendold and appendunknown Start Start Error Start End Error End Start

The important things to note are:

(1) The behavior of the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, and xlf95_r7 commands when you do not specify an option is different from XL Fortran Version 2.3 in this case. The Fortran 90 and Fortran 95 standards require this behavior. To minimize migration problems, the xlf, xlf_r, xlf_r7, f77, and fort77 commands keep the same default as XL Fortran Version 2.3 and append to the end of the file.

Attention: If your program depends on the old behavior to append to the end of an existing file with STATUS='OLD', you need to use the option -qposition=appendold or POSITION= specifiers when making the switch to the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, or xlf95_r7 command. Otherwise, when you compile the program with these commands and run it, the new data will overwrite the file instead of appending to it.

(2) -qposition=appendold produces the default XL Fortran Version 2.3 behavior for positioning the file pointer. This option is in the configuration-file stanza for the xlf, xlf_r,, xlf_r7, f77, and fort77 commands but is not in the configuration-file stanza for the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, and xlf95_r7 commands.
(3) This file position was not possible in XL Fortran Version 2.3.

Preserving the XL Fortran Version 2.3 File Positioning

If you are upgrading from XL Fortran Version 2.3 and want the file positioning to work the same way as before, note the following guidelines:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]