Re: Utility functions from gnome-libs



On 5 Jul 2000, Owen Taylor wrote:

> 
> Tim Janik <timj@gtk.org> writes:
> 
> > On 3 Jul 2000, Owen Taylor wrote:
> > 
> > > 
> > > gnome-libs has a number of "should be in GLib" functions that
> > > it would be nice to to really move in GLib for GLib-2.0.
> > > 
> > > The main interesting functions are the following functions
> > > from gnome-utils.h:
> > > 
> > > enum {
> > > 	G_FILE_TEST_ISFILE=1<<0,
> > > 	G_FILE_TEST_ISLINK=1<<1,
> > > 	G_FILE_TEST_ISDIR=1<<2,
> > > 	G_FILE_TEST_EXISTS=(1<<0)|(1<<1)|(1<<2) /*any type of file*/
> > > };
> > > 
> > > gboolean g_file_test   (const char *filename, int test);
> > > gboolean g_file_exists (const char *filename);
> > > 
> > > (These might alternatively be called g_file_race() ;-), but 
> > > they are useful for a lot of things, and a note in the
> > > docs about security implications should be OK.)
> > 
> > no, that's not a good idea. instead, it'll probably not hurt to
> > simply implement g_file_test() in terms of:
> > 
> > typedef enum
> > {
> >   G_FILE_IS_FILE	= 1 << 0,
> >   G_FILE_IS_LINK	= 1 << 1,
> >   G_FILE_IS_DIR		= 1 << 2,
> >   G_FILE_EXISTS		= G_FILE_IS_FILE | G_FILE_IS_LINK | G_FILE_IS_DIR
> > } GFileType;
> 
> Yes, the enumeration should be named, not anonymous. Was there
> another objection or was that all?
> 

i'm sorry, i don't quite understand your question.

> 
> Regards,
>                                         Owen
> 

---
ciaoTJ





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