Re: adding new info to GnomeVFSFileInfo



On Thu, 2002-09-12 at 09:55, Christophe Fergeau wrote:
> Hi,
> 
> Currently it seems that GnomeVFSFileInfo doesn't report some very
> useful information : whether an URI is readable, writeable or
> executable. 
> This is quite annoying since, for example, this prevents gedit from 
> being able to tell if it can edit a remote location or not. Nautilus
> has some code to try to handle that, but it probably will only work in
> the local case. 
> 
> What I'm suggesting is to report these permissions (ie the values
> returned by access(2) in the local case) in the GnomeVFSFileInfo
> struct. There we have 2 possibilities: add it to the permissions
> field, or use one of the padding pointers at the end of the struct to
> store them (not really a good idea to use one of those to only store 3
> bits imo), and to add a new member to  GnomeVFSFileInfoFields to
> report if the information about the authorizations is there or not.
> 
> Does it seem sensible ? Did I miss something ? And more importantly,
> will a patch doing that be accepted or not ?

You already have the information (where this makes sense, e.g. with
local file access) in the permissions field of GnomeVFSFileInfo. What
you probably want is something like:

gboolean gnome_vfs_access (GnomeVFSURI *uri, GnomeVFSAccessType access);

where "access" is a handle (probably something like a GType) to describe
"read", "write", "execute", "get ownership", "fertilize" :-P access (you
get the idea).

This should really be part of the "enhanced permissions" stuff I've been
babbling about in the last time. In fact, I've planned to implement
this, probably a bit more generalized like:

gboolean gnome_vfs_access_user (GnomeVFSURI *uri, GnomeVFSUser *user,
GnomeVFSAccessType access);

where the above is a shortcut for:

gnome_vfs_access_user (uri, gnome_vfs_user_myself(), access);

(Drumroll, please:) "It is on the agenda."

You just have to be a bit patient -- after all, I've just returned from
vacation.

Nils
-- 
Nils Philippsen / Berliner Straße 39 / D-71229 Leonberg //
+49.7152.209647
   nils wombat dialup fht-esslingen de / nils redhat de / nils lisas de
   PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011
       Ever noticed that common sense isn't really all that common?

Attachment: signature.asc
Description: This is a digitally signed message part



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