[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: File syncing

From: averstak
Subject: RE: File syncing
Date: Tue, 08 May 2001 12:19:05 -0400

Either fflush or fclose must do what you want.  When any of
these returns, the output must be in the system buffer or on
the disk.  In either case, it will be visible to all other
processes.  I've used these C library functions for years
and never had a problem.

Synch() makes sure everything is written to the disk, but
this is not necessary in your situation.  Synch() is more
like a checkpoint for fault tolerance, not something that an
application programmer should care about.


>===== Original Message From "Michael C. Riedl" <address@hidden> =====
>Hi there!
>Between file operations with fopen() / fclose() and file operations with
>something like system('grep ...') I found that I need to do sleeps in
>order to make sure the file is properly closed before it is accessed the
>next time.
>Of course this is very bad style as the minimum time to sleep depends on
>the speed of the computer and it's work load.
>How can I make sure the files are synced in a proper way (fflush() and
>system('sync') don't seem to be what I need)
>Octave is freely available under the terms of the GNU GPL.
>Octave's home on the web:
>How to fund new projects:
>Subscription information:

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]