AW: KIO slaves + chown/chgrp

nf2 nf2 at scheinwelt.at
Fri Jul 20 12:41:39 BST 2007


David Faure wrote:
> On Thursday 19 July 2007, Nhuh Put wrote:
>   
>> Im Auftrag von Martin Koller
>> Gesendet: Mittwoch, 18. Juli 2007 02:20
>> An: kde-core-devel at kde.org
>> Betreff: Re: KIO slaves + chown/chgrp
>>
>>     
>>> On Tuesday 17 July 2007, you wrote:
>>>
>>>       
>>>> I don't like the use of uid_t and gid_t because it's unportable to Windows,
>>>> and because with remote protocols (e.g. fish) we don't know the numerical
>>>> ids used by the remote system. How about using strings instead, just like
>>>> the UDS entries returned by a listDir() contain strings for user and group?
>>>>         
>>> OK, good point. Changed that.
>>>       
>
> Looks good now, thanks Martin.
>
>   
>> You could also try to use the KUser /KUserGroup classes.
>>     
>
> Again, how would this work with remote systems?
>
>   
perhaps you should also have a look how the new GVFS handles setting and 
reading file attributes. it seems to have a quite flexible model of 
"named" attributes (with namespaces)...

gfileinfo.h:

/* Calculated Access Rights for current user */

#define G_FILE_ATTRIBUTE_ACCESS_READ "access:read"               /* 
boolean */
#define G_FILE_ATTRIBUTE_ACCESS_WRITE "access:write"             /* 
boolean */
#define G_FILE_ATTRIBUTE_ACCESS_EXECUTE "access:execute"         /* 
boolean */
#define G_FILE_ATTRIBUTE_ACCESS_DELETE "access:delete"           /* 
boolean */
#define G_FILE_ATTRIBUTE_ACCESS_RENAME "access:rename"           /* 
boolean */

[...]

/* Unix specific attributes */

#define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix:device"               /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_INODE "unix:inode"                 /* 
uint64 */
#define G_FILE_ATTRIBUTE_UNIX_MODE "unix:mode"                   /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_NLINK "unix:nlink"                 /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_UID "unix:uid"                     /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_GID "unix:gid"                     /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_RDEV "unix:rdev"                   /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix:block_size"       /* 
uint32 */
#define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix:blocks"               /* 
uint64 */

[...]

/* Owner attributes */

#define G_FILE_ATTRIBUTE_OWNER_USER "owner:user"                 /* 
string */
#define G_FILE_ATTRIBUTE_OWNER_GROUP "owner:group"               /* 
string */


from gfile.h :

[...]

GFileAttributeInfoList *g_file_query_settable_attributes  
(GFile                      *file,
                               GCancellable               *cancellable,
                               GError                    **error);

GFileAttributeInfoList *g_file_query_writable_namespaces  
(GFile                      *file,
                               GCancellable               *cancellable,
                               GError                    **error);

gboolean                g_file_set_attribute              
(GFile                      *file,
                               const char                 *attribute,
                               const GFileAttributeValue  *value,
                               GFileGetInfoFlags           flags,
                               GCancellable               *cancellable,
                               GError                    **error);

[...]

http://www.gnome.org/~alexl/git/gvfs.git













More information about the kde-core-devel mailing list