Figure 24. 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:
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.
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: