xref: /original-bsd/usr.bin/f77/libI77/test/f2.f (revision 9d81f6f7)
1C From aho@ Tue Aug 23 13:07:25 1983
2C Date: Tue, 23 Aug 83 13:04:19 PDT
3C From: aho@@ (Alan Hopkins)
4C Subject: 4.2 rewind problem
5C
6C Here is a chunk of code that does not seem to operate properly
7C on bach.  The file does not contain any data at completion.
8
9	 program aho
10         open ( unit=13, form='unformatted', status='unknown',
11     .	 access='sequential',file='UNIX' )
12	 do 5 i = 1, 2
13	    ieot = -i
14	    write(13) ieot
15    5    continue
16	 endfile(13)
17	 call system("od -Iw12 UNIX")
18	 write(13) 3
19	 write(13) 4
20C	 call flush(13)
21	 call system("od -Iw12 UNIX")
22	 backspace(13)
23	 backspace(13)
24	 read(13) i
25	 write(*,*) "3 ==", i
26	 write(13) 5
27         rewind(13)
28	 call system("od -Iw12 UNIX")
29	 close(13)
30	 call system("od -Iw12 UNIX")
31	 stop
32	 end
33
34