Re: Discovering if a file is read-only



On Tue, 2004-06-08 at 23:54, Murray Cumming wrote:
> I am examining GnomeVfsFileInfo::permissions on a GnomeVfsFileInfo that
> I got from gnome_vfs_get_file_info_from_handle() after opening the
> GnomeVfsUriHandle with gnome_vfs_open(), with the GNOME_VFS_OPEN_READ
> option.
> 
> When I use it on a local file that is not writable by the group, user,
> or others, it does not seem to set the GNOME_VFS_PERM_ACCESS_WRITABLE
> flag.
>  
> So, should I be able to use GNOME_VFS_PERM_ACCESS_WRITABLE to check
> whether the file is writable by the current user? Or do I need to use
> GNOME_VFS_PERM_USER_WRITE, GNOME_VFS_PERM_GROUP_WRITE,
> GNOME_VFS_PERM_OTHERS_WRITE and check whether the user is in the correct
> group?

Yes, that is the general idea. However you need to pass
GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS to get_file_info in the options
parameter. Also, looking at the code this only seems to be implemented
for get_file_info, not get_file_info_from_handle(). I guess we need to
implement that.  

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an oversexed white trash cat burglar on his last day in the job. She's a 
blind green-skinned lawyer from beyond the grave. They fight crime! 




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