24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

-qposition Option<br />

Syntax<br />

-qposition={appendold | appendunknown} ...<br />

POSITION({APPENDOLD | APPENDUNKNOWN} ...)<br />

Positions the file pointer at the end of the file when data is written after an OPEN<br />

statement with no POSITION= specifier and the corresponding STATUS= value<br />

(OLD or UNKNOWN) is specified.<br />

Rules<br />

The position becomes APPEND when the first I/O operation moves the file<br />

pointer if that I/O operation is a WRITE or PRINT statement. If it is a<br />

BACKSPACE, ENDFILE, READ, or REWIND statement instead, the position is<br />

REWIND.<br />

Applicable Product Levels<br />

The appendunknown suboption is the same as the <strong>XL</strong> <strong>Fortran</strong> Version 2 append<br />

suboption, but we recommend using appendunknown to avoid ambiguity.<br />

-qposition=appendold:appendunknown provides compatibility with <strong>XL</strong> <strong>Fortran</strong><br />

Version 1 and early Version 2 behavior. -qposition=appendold provides<br />

compatibility with <strong>XL</strong> <strong>Fortran</strong> Version 2.3 behavior.<br />

Examples<br />

In the following example, OPEN statements that do not specify a POSITION=<br />

specifier, but specify STATUS=’old’ will open the file as if POSITION=’append’<br />

was specified.<br />

xlf95 -qposition=appendold opens_old_files.f<br />

In the following example, OPEN statements that do not specify a POSITION=<br />

specifier, but specify STATUS=’unknown’ will open the file as if<br />

POSITION=’append’ was specified.<br />

xlf95 -qposition=appendunknown opens_unknown_files.f<br />

In the following example, OPEN statements that do not specify a POSITION=<br />

specifier, but specify either STATUS=’old’ or STATUS=’unknown’ will open the<br />

file as if POSITION=’append’ was specified.<br />

xlf95 -qposition=appendold:appendunknown opens_many_files.f<br />

Related In<strong>for</strong>mation<br />

See “File Positioning” on page 327 and the section on the OPEN statement in the<br />

<strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> Language Reference.<br />

<strong>XL</strong> <strong>Fortran</strong> Compiler-Option Reference 219

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!