Re: fsync in glib/gio



On Fri, 2009-03-13 at 11:37 +0100, Steve Frécinaux wrote:
> Alexander Larsson wrote:
> > Attached is a patch that makes sure we fsync before closing in the gio
> > file saving code and in g_file_set_contents().
> 
> Wouldn't fdatasync be sufficient in most case ?

In practical gio use there really is no difference. As soon as the size
of the file changes the metadata (st_size) changes, so a fdatasync()
implies fsync(). The difference is only apparent when you do in place
changing of a file, which would happen e.g. in a database file.




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