Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ucla-cs!ames!ucbcad!ucbvax!EQL.Caltech.EDU!rankin From: rankin@EQL.Caltech.EDU (Pat Rankin) Newsgroups: comp.os.vms Subject: re: Files in FORTRAN; flushing output buffers Message-ID: <870420162457.006@EQL.Caltech.Edu> Date: Mon, 20-Apr-87 18:26:35 EST Article-I.D.: EQL.870420162457.006 Posted: Mon Apr 20 18:26:35 1987 Date-Received: Wed, 22-Apr-87 00:33:25 EST Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 19 It is no longer necessary to resort to MACRO or USEROPEN routines in order to use SYS$FLUSH to flush RMS output buffers from Fortran. The run-time library contains a routine (FOR$RAB) that returns a pointer to the necessary RMS data structure. INTEGER *4 rabadr, FOR$RAB, sts, SYS$FLUSH ... c open the file for shared access OPEN ( lunit, SHARED, ... c get the address of the RMS Record Access Block rabadr = FOR$RAB( lunit) ... c add a record to the file--it will not show up yet if the I/O is buffered WRITE ( lunit, ... c flush the output buffer so that others can read our last record sts = SYS$FLUSH( %VAL(rabadr), , ) !2nd & 3rd args not used here ... Pat Rankin