--- In [email protected], "spudgun0" <[EMAIL PROTECTED]> wrote:
>
> Hi Mark and thank you for answering .
> I tried the commit() as a first way out but it
> didn't work. More, when I stop the program, and
> I gracefully shutdown all the threads, so that
> I expect all the I/O buffers to be flushed on
> the disk, it doesn't work either.
> I even tried to change the remote folder (where
> the thread writes) with a local one , but it had
> no effect. Some told me that the difference
> between using _open() (or _sopen() ) and fopen()
> is that in the first one the data is immediately
> flushed (i.e. the file system doesn't use its
> buffer) , the other instead, the fopen(), uses
> OS buffers so the real flushing of the data can be
> delayed .... but it seems this is not totally true
<snip>

You're right, this is NOT true. open() and fopen() do use OS buffers
under every sort of Unix/Linux; the sole exception is if you open() or
fopen() a raw device, but that's really a different story.

There have been OS's which didn't buffer in all cases; the earliest
versions of MS-DOS for example didn't buffer if you didn't explicitly
reserved RAM for this purpose, and also TOS (Atari ST) didn't
automatically buffer file I/O in the earliest versions. But nowadays
you can almost always bet on every halfway modern OS using buffers,
whether you like that or not.

Just my 2 pennies.

Regards,
Nico

Reply via email to