kioslave - stat function (newbie)

David Faure david at mandrakesoft.com
Wed Oct 9 09:56:19 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 09 October 2002 10:20, Brad Hards wrote:
> I'm trying to write an rsync kioslave. Despite the power of KDE, its going to
> be a long process for me. I basically have to figure out each section using
> simple examples, then add it to my code. I've read the kioslave tutorial from
> c'T, and it helped a lot, but I'm still struggling.
> 
> I've got the kioslave execing out to the rsync binary, returning results, and
> a simple parsing happening.
> 
> I'm stuck on stat().
> 
> Here is the test function I'm trying to get working. I assumed I'd get a
> single line entry.
> 
> void RsyncProtocol::stat(const KURL& url )
> {
[...]
> }
> 
> However all I'm getting is the "Name" and "Size" headers. No entries at all.
> listing=Access,Size,Date,Name,Type

Your stat() implementation looks fine, but if you want to see entries in a directory
listing, you need to implement listDir().

stat() is mostly used to know if a given URL is a file or a directory (not obvious
from the URL, e.g. http://www.kde.org/ is a file ;), and also to know its size,
mimetype, etc. But that's all for a single URL.
To list a directory, implement listDir().

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9o+8z72KcVAmwbhARAgChAJ4xkAdNYrxf7t8OAdpBYeanyQPrawCbBi2X
uI1hv45qdKHgIE7JDQztfOw=
=KN7n
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list