diff options
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/io.h | 2 | ||||
-rw-r--r-- | libgfortran/io/open.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index e262677..47a564f 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -153,7 +153,7 @@ namelist_info; /* Options for the OPEN statement. */ typedef enum -{ ACCESS_SEQUENTIAL, ACCESS_DIRECT, +{ ACCESS_SEQUENTIAL, ACCESS_DIRECT, ACCESS_APPEND, ACCESS_UNSPECIFIED } unit_access; diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 203964b..c3b5dde 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -39,6 +39,7 @@ Boston, MA 02110-1301, USA. */ static const st_option access_opt[] = { {"sequential", ACCESS_SEQUENTIAL}, {"direct", ACCESS_DIRECT}, + {"append", ACCESS_APPEND}, {NULL, 0} }; @@ -486,6 +487,19 @@ st_open (void) generate_error (ERROR_BAD_OPTION, "Cannot use POSITION with direct access files"); + if (flags.access == ACCESS_APPEND) + { + if (flags.position != POSITION_UNSPECIFIED + && flags.position != POSITION_APPEND) + generate_error (ERROR_BAD_OPTION, "Conflicting ACCESS and POSITION " + "flags in OPEN statement"); + + notify_std (GFC_STD_GNU, + "Extension: APPEND as a value for ACCESS in OPEN statement"); + flags.access = ACCESS_SEQUENTIAL; + flags.position = POSITION_APPEND; + } + if (flags.position == POSITION_UNSPECIFIED) flags.position = POSITION_ASIS; |