This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch inquire statement on open direct access file


On Tuesday 30 November 2004 12:37, Bud Davis wrote:
> 2004-12-1  Bud Davis  <bdavis9659@comcast.net>
>
>  * io/inquire.c (inquire_via_unit): do not allow a direct access
>  file to be opened for sequential I/O.

Ok with a few changes.

> ! check to see that you cannot open a direct access file
> ! for sequential i/o.
> ! derived from NIST test fm910.for
>         CHARACTER*10 D4VK,CDIR
>         CDIR = 'TEMPFILE'
>         OPEN(FILE=CDIR, UNIT=7, ACCESS='DIRECT',RECL=132)

Use status='scratch' rather than an explicit filename.

>         INQUIRE(UNIT=7,SEQUENTIAL=D4VK)
>         CLOSE(UNIT=7,STATUS='DELETE')
>         PRINT*,D4VK

Check for expected value and call abort if it's wrong.

>         END
<...>
> !       // disallow an open direct access file to be accessed
> !       // sequentially

Use C /* */ comments, not C++ //

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]