Create calls result in a call to
using the mode shown in Table 6.1
OPEN CREATE Append_File "r+" "w+" In_File "r" "w+" Out_File (Direct_IO) "r+" "w" Out_File (all other cases) "w" "w" Inout_File "r+" "w+"
If text file translation is required, then either
is added to the mode, depending on the setting of Text. Text file
translation refers to the mapping of CR/LF sequences in an external file
to LF characters internally. This mapping only occurs in DOS and
DOS-like systems, and is not relevant to other systems.
A special case occurs with Stream_IO. As shown in the above table, the
file is initially opened in
w mode for the
Out_File cases. If a
subsequently requires switching from reading to writing or vice-versa,
then the file is reopened in
r+ mode to permit the required operation.