Newsgroups: comp.lang.c
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!peruvian.utah.edu!tmurphy
From: tmurphy%peruvian.utah.edu@cs.utah.edu (Thomas Murphy)
Subject: Re: fseek fread fwrite fflush
Date: 12 Apr 91 19:45:47 MDT
Message-ID: <1991Apr12.194547.18080@hellgate.utah.edu>
Organization: University of Utah CS Dept., Salt Lake City
References: <1991Apr13.003817.12434@watdragon.waterloo.edu>

In article <1991Apr13.003817.12434@watdragon.waterloo.edu> amewalduck@trillium.waterloo.edu (Andrew Walduck) writes:
>I've got a question about fseek, fread, fwrite and fflush....
>Is it necessary to do the following?
>fflush(fp);
>fseek(fp....);
>fwrite(fp...);

You are always safest if you flush streams btwn io phases...this goes
for io to the console or to some file...thus if you have been reading
you should flush before writing and again before returning to reading
again and in addition flush before closing.....sounds like rules of
the john eh?

murph
thomas murphy
u of u
tmurphy%peruvian@cs.utah.edu



