X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libgfortran%2Fio%2Fopen.c;h=b3360792a22e15c163550a15e73c6d1eaf155e7f;hp=3515bef75cef84e3ea40b912056204141c7917d1;hb=4d8ee55b7d3fd31406d095afb53a1fac983490c6;hpb=e83964b23af081bec09add65a9ab27772c729bad 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;