WebDAV issue - rename of directories

Hamish Rodda rodda at kde.org
Sun Jan 1 13:08:53 GMT 2006


On Saturday 31 December 2005 01:38, David Faure wrote:
> 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).

Ok, I do prefer a) as most servers will work with the stat (apache2 is just 
being very strict) and then only when it fails will we have to retry.  Also, 
that way I don't need to wory about passing metadata from KIO::file_move.

I like the idea of using KDirLister cache more in KDE4.  I can also see scope 
for giving slaves more ability to tell KIO which way they work better (ie, 
for some slaves, doing lists is cheaper than doing several stats).

Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060102/80fb9d50/attachment.sig>


More information about the kfm-devel mailing list