Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!cornell!batcomputer!itsgw!nyser!cmx!anand From: anand@cmx.npac.syr.edu (Rangachari Anand) Newsgroups: comp.sys.encore Subject: File buffers Keywords: Buffered file input Message-ID: <585@cmx.npac.syr.edu> Date: 2 Aug 88 16:53:35 GMT Reply-To: anand@cmx.npac.syr.edu (Rangachari Anand) Distribution: na Organization: Northeast Parallel Architectures Center, Syracuse NY Lines: 19 This is a problem that others have surely faced on multiprocessors such as the Multimax. Consider a program which forks a number of child processes each of which need to do I/O from a given file. If the fscanf and fprintf functions are used, the buffering action seems to load a block of the file into a buffer which is in the private memory of a process. Then when other processes attempt to read from the same file, they load blocks of the file into their respective buffers. Thus they cant read the file in the correct sequence. I have managed to write my programs in such a way that they always use the same process to do all the I/O which is a nuisance. I tried to use the setbuff call to use a shared buffer but that did not seem to work. Any suggestions? Thanks R. Anand Internet: anand@amax.npac.syr.edu Bitnet: ranand@sunrise