X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Jason Mills Newsgroups: comp.os.msdos.djgpp Subject: Re: fstream and fflush Date: Fri, 22 Oct 2004 18:13:48 -0230 Organization: Memorial University of Newfoundland Lines: 30 Message-ID: References: <2tqpgmF245sdvU4 AT uni-berlin DOT de> <2tt2rhF22u71pU1 AT uni-berlin DOT de> NNTP-Posting-Host: jmills.ccore.mun.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: coranto.ucs.mun.ca 1098477829 12277 134.153.38.195 (22 Oct 2004 20:43:49 GMT) X-Complaints-To: usenet AT coranto DOT ucs DOT mun DOT ca NNTP-Posting-Date: Fri, 22 Oct 2004 20:43:49 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en In-Reply-To: <2tt2rhF22u71pU1@uni-berlin.de> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Hans-Bernhard Broeker wrote: > Jason Mills wrote: > >>Hans-Bernhard Broeker wrote: > > > [...] > >>for example. >>2. Perhaps unwisely, I was using stat() to query the file size >>periodically in order to rotate the log file based on file size. > > > Well, fstat() would probably have been wiser in this case. But the > main problem is that your program, as you write elsewhere, assumes the > operating to be Unix, whereas you're actually on DOS. DJGPP does try > rather hard to make DOS look and behave very much like Unix, but there > is a limit to that, and stat() and simultaneous access to the same > file by two independent system calls is about where that limit is. > > In actuality, fsync() would really have been recommendable on Linux, > too, for this task --- that you didn't seem to need it was more by > luck than by design. > Thanks enlightening me. (For some reason, I always assumed flush meant flush to the disk.....) Jason