Re: g_file_write()



On Tue, Mar 08, 2005 at 06:31:30PM -0600, Federico Mena Quintero wrote:
> On Tue, 2005-03-08 at 20:49 +0100, Soeren Sandmann wrote:
> > I have put up a new patch at
> >  
> >        http://www.daimi.au.dk/~sandmann/filewrite2.patch 
> > 
> > that should take care of most of the comments:
> > 
> > - Function is now called g_file_replace(). (I think
> >   g_file_replace_contents() suggests that permissions etc. are
> >   preserved).
> > 
> > - Documentation mentions that the write is atomic, and some of the
> >   traps.
> > 
> > - Uses fdopen(). Since we are already using fdopen() on Unix
> >   in one place, and Tor says that it works as expected on Windows I
> >   don't think this makes glib any less portable than it already is.
> > 
> > - Test/unlink is only done on Windows and only when an initial rename
> >   attempt failed.
> 
> Note that libgsf (or is that libgnome-office these days?) has stuff like
> this.

libgoffice is the application and utility collection
libgsf is the i/o abstraction

libgsf's GsfOutputStdio writes to a tmp file then does a rename
it also handles symbolic links and optinally leaves the old file
around as <foo>.bak



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