xref: /csrg-svn/usr.bin/f77/libI77/test/f2.f (revision 47949)
1*47949SbosticC
2*47949SbosticC Copyright (c) 1983 The Regents of the University of California.
3*47949SbosticC All rights reserved.
4*47949SbosticC
5*47949SbosticC %sccs.include.proprietary.f%
6*47949SbosticC
7*47949SbosticC	@(#)f2.f	5.2 (Berkeley) 04/12/91
8*47949SbosticC
9*47949Sbostic
1043971SbosticC From aho@ Tue Aug 23 13:07:25 1983
1143971SbosticC Date: Tue, 23 Aug 83 13:04:19 PDT
1243971SbosticC From: aho@@ (Alan Hopkins)
1343971SbosticC Subject: 4.2 rewind problem
1443971SbosticC
1543971SbosticC Here is a chunk of code that does not seem to operate properly
1643971SbosticC on bach.  The file does not contain any data at completion.
1743971Sbostic
1843971Sbostic	 program aho
1943971Sbostic         open ( unit=13, form='unformatted', status='unknown',
2043971Sbostic     .	 access='sequential',file='UNIX' )
2143971Sbostic	 do 5 i = 1, 2
2243971Sbostic	    ieot = -i
2343971Sbostic	    write(13) ieot
2443971Sbostic    5    continue
2543971Sbostic	 endfile(13)
2643971Sbostic	 call system("od -Iw12 UNIX")
2743971Sbostic	 write(13) 3
2843971Sbostic	 write(13) 4
2943971SbosticC	 call flush(13)
3043971Sbostic	 call system("od -Iw12 UNIX")
3143971Sbostic	 backspace(13)
3243971Sbostic	 backspace(13)
3343971Sbostic	 read(13) i
3443971Sbostic	 write(*,*) "3 ==", i
3543971Sbostic	 write(13) 5
3643971Sbostic         rewind(13)
3743971Sbostic	 call system("od -Iw12 UNIX")
3843971Sbostic	 close(13)
3943971Sbostic	 call system("od -Iw12 UNIX")
4043971Sbostic	 stop
4143971Sbostic	 end
4243971Sbostic
43