Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.ARPA Path: utzoo!linus!decvax!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: Reading Logfiles that are currently write-open Message-ID: <9197@ucbvax.ARPA> Date: Sat, 20-Jul-85 13:51:59 EDT Article-I.D.: ucbvax.9197 Posted: Sat Jul 20 13:51:59 1985 Date-Received: Sun, 21-Jul-85 23:08:36 EDT Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 34 From: <#D15%DDATHD21.BITNET@WISCVM.ARPA> Hi Don, Kevin is right, you can share variable-lenghts, sequential files. There are no problems if you have only one WRITER and one or more READERS. There are problems if you need more than one WRITER, because there is no record-locking on sequential files. All you have to do in the first case, is to ensure that the RMS buffers are really written to disk. For this purpose you can use the SYS$FLUSH service. The following FORTRAN-77 program (Hi Kevin, I do my system programming in FORTRAN...) shows how to prepare a file for sharing. When the program is running you will have no problem to TYPE or COPY the file TEST.DAT . PROGRAM Share_Test INTEGER I,J,FOR$RAB,SYS$SHARE,STATUS C OPEN(UNIT=1,FILE='TEST.DAT',STATUS='NEW',SHARED) ! Open File I = FOR$RAB(1) ! Get RAB-Adress J = 0 ! Init Counter C DO WHILE (.TRUE.) ! Infinite Loop WRITE(1,*) ' TEST',J ! Write File J = J + 1 ! Update Counter IF(J.GT.100) THEN ! Time to Update File J = 0 STATUS = SYS$FLUSH(%VAL(I)) ! Update File if necessary IF(.NOT.STATUS) CALL SYS$EXIT(%VAL(STATUS)) ! Exit on Error END IF END DO END