[Mono-dev] Cross-platform fsync()

Robert Jordan robertj at gmx.net
Thu Jan 11 06:13:07 EST 2007


Alan McGovern wrote:
>> > Have you tried FileStream.Flush()? ;)
>>
>> Flush() intentionally doesn't call fsync nor FlushFileBuffers.
> 
> 
> Well, the original reason cited for a cross platform fsync() call was to
> perform a flush to disk operation on a filestream. I believe that's
> *exactly* what FileStream.Flush() is for. So unless there's a different
> reason that he needs fsync(), what's wrong with calling FileStream.Flush()?

The performance would be extremely bad if those calls would be
performed by FileStream.Flush. Have a look at the man page of fsync(2)
and FlushFileBuffers().

Robert




More information about the Mono-devel-list mailing list