Chettri@UDEL.EDU.UUCP (10/02/87)
Dear info-vaxers
I wrote two short programs in FORTRAN, one called TEST.FOR and the other called
HAT.FOR. TEST.FOR opens a file called TEST.DAT which is SHARED.
HAT.FOR opens TEST.DAT as SHARED, READONLY. However on trying to read the file
TEST.DAT, I get a message saying END OF FILE. If I try to type the file T
TEST.DAT to my screen I get my prompt back "$" with no records seeming to
exist in the file. A DIR/SIZ=ALL TEST.DAT shows the following numbers
0/2345 (the number after the slash increments at regular intervals but the
number before the slash is always 0).
I realize that the records are not being written to the file TEST.DAT until
termination of the file TEST.EXE. However I want to emulate the behaviour of
a batch log file (i.e. almost immediate update). Is there any way to do this?
I realize this question may have come up in the past, so reply direct to me.
If there is sufficient interest, or if you believe that this example
warrants wider distribution you can ofcourse reply directly to the group.
Program TEST.FOR follows
Open(unit=22, file='test.dat',status='new',shared)
Do 10 i =1, 1000000
Write(22,*)'This is a test'
10 Continue
End
Program HAT.FOR follows
Character*80 line
Open(unit=22, file='test.dat',status='old',readonly,shared)
Do 10 i =1, 1000
read(22,*)line
Write(5,*)line
10 Continue
End
Sincerely,
Samir Chettri