Re: fsync in glib/gio
- From: Alexander Larsson <alexl redhat com>
- To: Steve Frécinaux <nudrema gmail com>
- Cc: gtk-devel-list gnome org
- Subject: Re: fsync in glib/gio
- Date: Fri, 13 Mar 2009 13:45:48 +0100
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.
] [Thread Prev