Re: Fwd: check if current process has R/W access to a file.



On Sat, 2004-06-26 at 19:27, mhbouhmadi free fr wrote:
> Hi,
> I am looking for a function that determine the accessibility of a file like the
> unix standard "int access(char* _path, int _mode)" function.
> 
> I've searched the GnomeVFS API without luck.
> the GnomeVFSFileInfo has enough information about permissions and owners that it
> *seems* to me that a function like 
> "bool gnome_vfs_has_access(GnomeVFSFileInfo, AccessKind)"
> should not be difficult to write (and very usefull).
> 
> Does such a function exist in Gnome VFS?

Call gnome_vfs_get_file_info with a flag of
GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS and check
GNOME_VFS_PERM_ACCESS_READABLE, GNOME_VFS_PERM_ACCESS_WRITABLE,
GNOME_VFS_PERM_ACCESS_EXECUTABLE in info->permissions (valid if
GNOME_VFS_FILE_INFO_FIELDS_ACCESS is set in valid_fields).

> Thank you.
> 
> 
> 
> _______________________________________________
> gnome-vfs-list mailing list
> gnome-vfs-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-vfs-list
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a fiendish bohemian Green Beret looking for 'the Big One.' She's a 
brilliant blonde pearl diver fleeing from a Satanic cult. They fight crime! 




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