WebDAV issue - rename of directories

David Faure faure at kde.org
Fri Dec 30 14:38:36 GMT 2005


On Thursday 29 December 2005 05:45, Hamish Rodda wrote:
> c) find another way to recognise within the slave's rename() function that the 
> URLs actually point to directories rather than files. Perhaps we could set 
> some metadata?

That's the solution I would have liked.
But now I looked at the code, and in fact CopyJob doesn't know if something
is a file or a directory before renaming it; it tries renaming (see startRenameJob())
before it stats the src url. It would be bad for performance if we make it
stat() the source for all protocols, even those where it's not necessary...

So I'm concluding that the best solution would be
d) change the kioslave to stat the url before renaming it.
Yes, one more roundtrip, but if KIO::CopyJob is to provide that information,
it would currently (*) mean that same roundtrip anyway [plus the app<->ioslave overhead],
and touching the rather complex copyjob code, and making it more complex 
to avoid that roundtrip on protocols that don't need it... So why not just do
it from webdav::rename()?

We can improve this by actually shipping this metadata we're talking about
when it's known from kio - e.g. from KIO::file_move it's known that it's a file.

(*) and in kde4 the idea that was raised on kde-core-devel was to use
the KDirLister cache in order to get info on urls without having to ask
the slave, if we recently listed that dir for e.g. a konq or kfiledialog view anyway.
But this would simply mean one more case where the metadata is set,
not a 100% chance of having the information; so we still need the kioslave
to be able to handle the case where it doesn't know if it's renaming a file
or a directory, hence d)  (or your a) if you prefer).

-- 
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 kfm-devel mailing list