From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 28-DEC-1992 21:55 28-DEC-1992 21:55:00.00 To: info-vax@sri.com CC: Subj: Re: VAX c On Dec 25, 3:08am, Ehud Gavron 602-570-2000 x. 2546 wrote: > Subject: Re: VAX c >In article <1992Dec24.173709.16437@mailer.cc.fsu.edu>, cliff@evax9.eng.fsu.edu writes... ># >#Is there a way to get VAX C to flush the VMS file buffers? ># >#I've got a program that reads data in for the tta2: port and then writes it to >#a file. The problem is that the data doesn't get written to the file until the >#buffer is full, and that may not happen but once every day or two. > > fflush(stream) > > example: > fflush(stdout); > You may also want to force RMS to flush its buffers. Use fsync(file-number) to do this. You can use the fileno() macro to get the file-number from a FILE structure. The last time I checked, fsync() was still undocumented, but it's been around for years, and hasn't changed, so it's probably safe enough to use. Louis ------------------------------------------------------------------------- / Louis Dunne / / / VMS/UNIX Systems / Internet: louis@barra.com / / / Phone: +1 510 649-4229 / / BARRA, Inc. / Fax: +1 510 548-4374 / / 1995 University Ave., Suite 400 / / / Berkeley, CA 94704 / / -------------------------------------------------------------------------