Re: adding new info to GnomeVFSFileInfo



Le mar 08/10/2002 à 10:34, Michael Meeks a écrit :
> Hi Christophe,
> 
> On Thu, 2002-10-03 at 23:16, Christophe Fergeau wrote:
> > >        if (options & GNOME_VFS_FILE_INFO_GET_MIME_TYPE)
> > > 
> > > 	So we avoid doing 3 (potential synchronous network round-trip) access
> > > calls, per operation.
> > 
> > I don't understand exactly what this flag is for. Is it used to indicate
> > that an app wants "extended" info about a file ?
> 
> 	The idea is that you don't want to do expensive sys-calls for
> information you don't need. Doing 'just' 3 accesses per stat call is not
> acceptable if the results are not going to be used at all. Thus it must
> be masked by such an options guard.
> 

I thought a little more to that, and I'm really not comfortable with the
way user can prevent gnome_vfs_get_file_info from doing expensive work
when it's not needed. Currently, the GnomeVFSFileInfoOptions parameter
seems to have been made with the file method in mind where the whole
info struct can be filled with only two expensive operations: one call
to stat and another expensive operation to get the mime type.
But on remote file systems, each field of the GnomeVfsFileInfo struct
can be expensive to fill, so an additional parameter to
gnome_vfs_get_file_info of type GnomeVFSFileInfoFields to indicate which
fields we are interested in would be much more logical imo.

Anyway, I don't see how that can be changed now, so I'll just add a new
flag to GnomeVFSFileOptions (unless I should use
GNOME_VFS_FILE_INFO_GET_MIME_TYPE ? but I think this will be confusing,
adding a GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS is probably better)

Christophe



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