KIO slaves + chown/chgrp

David Faure faure at kde.org
Tue Jul 17 22:50:48 BST 2007


On Tuesday 17 July 2007, Martin Koller wrote:
> Hi list,
> 
> On Saturday 04 November 2006, David Faure wrote:
> > On Sat Nov 4 2006, Martin Koller wrote:
> > > On Saturday 04 November 2006 18:57, Richard Moore wrote:
> > > > KIO supports this, see:
> > > >
> > > > http://www.englishbreakfastnetwork.org/apidocs/apidox-kde-3.5/kdelibs-a
> > > >pido cs/kio/kio/html/classKIO_1_1ChmodJob.html
> > >
> > > But I find no method
> > > virtual chgrp(...) in KIO::SlaveBase like it is for chmod() ...
> > > So how is a kio-slave notified about doing chgrp/chown ?
> >
> > It isn't. ChmodJob calls the unix chown()/chgrp() functions directly (for
> > local urls only of course). Probably because we couldn't add virtuals to
> > SlaveBase during the kde3 timeframe, and because implementing it for the
> > local file system was the priority. I'm fine with this being virtualized
> > for kde4, i.e. delegated to SlaveBase.
> 
> I attach here a patch which tries to implement the basis to have chown/chgrp 
> virtualized in SlaveBase for KDE 4.
> I think this is important to get in as API will soon be frozen.

Thanks for doing this! It was on my huge todo list, but I never got around doing it.

> Of course the implementation is not complete, but I hope at least the API is 
> complete to start to implement the real working code (doing chmod) later on.

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?

> Can someone give me a pointer where chmod() hast to be implemented at least 
> for local files to start with ?

In kdelibs/kioslave/file/file.cc :)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list