GNU Fortran supports the additional legacy I/O specifiers
SHARE with the compile flag -fdec, for compatibility.
CARRIAGECONTROL specifier allows a user to control line termination settings between output records for an I/O unit. The specifier has no meaning for readonly files. When
CARRAIGECONTROL is specified upon opening a unit for formatted writing, the exact
CARRIAGECONTROL setting determines what characters to write between output records. The syntax is:
Where cc is a character expression that evaluates to one of the following values:
||One line feed between records (default)|
||Legacy interpretation of the first character (see below)|
||No separator between records|
CARRIAGECONTROL='FORTRAN', when a record is written, the first character of the input record is not written, and instead determines the output record separator as follows:
|Leading character||Meaning||Output separating character(s)|
||Overprinting||Carriage return only|
||New line||Line feed and carriage return|
||Skip line||Two line feeds and carriage return|
||New page||Form feed and carriage return|
||Prompting||Line feed (no carriage return)|
||Overprinting (no advance)||None|
READONLY specifier may be given upon opening a unit, and is equivalent to specifying
ACTION='READ', except that the file may not be deleted on close (i.e.
STATUS="DELETE"). The syntax is:
SHARE specifier allows system-level locking on a unit upon opening it for controlled access from multiple processes/threads. The
SHARE specifier has several forms:
OPEN(..., SHARE=sh) OPEN(..., SHARED) OPEN(..., NOSHARED)
Where sh in the first form is a character expression that evaluates to a value as seen in the table below. The latter two forms are aliases for particular values of sh:
|Explicit form||Short form||Meaning|
||Exclusive (write) lock|
||Shared (read) lock|
In general only one process may hold an exclusive (write) lock for a given file at a time, whereas many processes may hold shared (read) locks for the same file.
The behavior of locking may vary with your operating system. On POSIX systems, locking is implemented with
fcntl. Consult your corresponding operating system’s manual pages for further details. Locking via
SHARE= is not supported on other systems.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.