diff options
Diffstat (limited to 'libgfortran/io/open.c')
-rw-r--r-- | libgfortran/io/open.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 3515bef75ce..b3360792a22 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -40,6 +40,7 @@ static const st_option access_opt[] = { {"sequential", ACCESS_SEQUENTIAL}, {"direct", ACCESS_DIRECT}, {"append", ACCESS_APPEND}, + {"stream", ACCESS_STREAM}, {NULL, 0} }; @@ -214,7 +215,9 @@ edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags) if (sseek (u->s, file_length (u->s)) == FAILURE) goto seek_error; - u->current_record = 0; + if (flags->access != ACCESS_STREAM) + u->current_record = 0; + u->endfile = AT_ENDFILE; /* We are at the end. */ break; @@ -432,6 +435,13 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) if (flags->access == ACCESS_DIRECT) u->maxrec = max_offset / u->recl; + + if (flags->access == ACCESS_STREAM) + { + u->maxrec = max_offset; + u->recl = 1; + u->last_record = 1; + } memmove (u->file, opp->file, opp->file_len); u->file_len = opp->file_len; |