Re: semantics of gnome_vfs_get_file_info_from_handle



On Tue, 2003-02-04 at 04:11, Alexander Larsson wrote:

> I've been thinking some about this, and I'm not sure this is the right 
> thing. Adding API and vfs-method functions complicates implementation and 
> API and should be done very rarely.

In general I agree.

> This API would basically only be used for you to avoid doing an extra 
> request on http sources when getting the mimetype, since you get that on 
> open anyway. I don't see it being useful in any other way.

Actually I think the file method at least could also use it, since as I
said before it does a stat anyways in the open call.

> And since you get the info in the header when you open the stream that 
> info should be pretty much up to date[1]. I think your initial proposal 
> migh be better, at least for the http backend. For the file backend I'm 
> not so sure, but the extra i/o is less problematic there.

There is actually a third alternative that I just thought of; create a
new open method like:

GnomeVFSResult gnome_vfs_open_full (const char *uri,
				    GnomeVFSOpenMode mode,
				    GnomeVFSHandle **handle,
				    GnomeVFSFileInfo *info);

This would return any information gathered during the open along with
the handle.  Now, we can implement the old gnome_vfs_open entirely in
terms of this new one.  So the old open module method would be
deprecated in favor of this, but we wouldn't lose backwards
compatibility.

What do you think?




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