| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| From: | Jason Mills <jmills AT cs DOT mun DOT ca> |
| 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: | <clbre5$bvl$1@coranto.ucs.mun.ca> |
| References: | <cl92jr$3ro$1 AT coranto DOT ucs DOT mun DOT ca> <cl96k3$45r$1 AT coranto DOT ucs DOT mun DOT ca> <2tqpgmF245sdvU4 AT uni-berlin DOT de> <clanbn$8j1$1 AT coranto DOT ucs DOT mun DOT ca> <2tt2rhF22u71pU1 AT uni-berlin DOT de> |
| NNTP-Posting-Host: | jmills.ccore.mun.ca |
| Mime-Version: | 1.0 |
| 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 |
Hans-Bernhard Broeker wrote: > Jason Mills <jmills AT cs DOT mun DOT ca> 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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |