xfdesktop

Benedikt Meurer Benedikt.Meurer at unix-ag.uni-siegen.de
Fri Mar 14 11:26:36 CET 2003


On Fri, 14, Mar 2003, Jasper Huijsmans wrote:

> On Fri, 14 Mar 2003 10:54:36 +0100
> Benedikt Meurer <Benedikt.Meurer at unix-ag.uni-siegen.de> wrote:
> 
> > > 
> > > Why do we need file locking?
> > 
> > To prevent data file corruption in any case.
> 
> Hmm, xfdesktop is already ensured to be a unique app, so there is not
> much chance of another process reading the file, is there?

Thats why I said "in any case". Its better to have it now, since errors
causing data corruption are very hard to track.

> > > What's wrong with g_file_get_contents()?
> > 
> > a) a single read(2) is sufficient to read the contents of a regular
> > file
> >    on UNIX systems
> > b) g_file_get_contents() does not use file locking.
> > 
> 
> Well, the reason I ask is that I prefer to use glib functions as much as
> possible because of portability reasons (oh, and convenience of course).
> 
> I cannot judge the necessity of these things, so I'm glad you have a
> look at them. I just want to make sure we take as much advantage of the
> libraries we depend on as possible :)

Hm. I prefer to get things done with the system as much as possible without
the requirement of 3rd party functions (which are indeed only wrappers around
the system libraries). If something can be done with a simple system call,
I don't see any reason to use a high level wrapper function to do the job.



More information about the Xfce4-dev mailing list