Mail Archives: djgpp/2004/10/22/15:01:20
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.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -