KIO and KFM and copy/move/delete operations

Rajko Albrecht ral at alwins-world.de
Mon Oct 17 13:55:02 BST 2005


> On Monday 17 October 2005 12:01, Rajko Albrecht wrote:
> Is this about file:/ to svn:/, or svn:/ to svn:/ ?
svn:/ to svn:/
file:/ to svn:/ isn't possible.

> Yes, for moving from file:/, but not for copying or moving inside svn:/ at
> this point.
> This could easily be added (to KDE4...) if we agree on the solution.
That would be great.

> you can add deleteRecursive=true in the .protocol file, and then only the
> toplevel
> will be url will be passed to the delete operation.
Ok, that works perfect.

> There isn't a copyRecursive=true though, because there wasn't a case where
> it made sense up to now.
> By letting kfm (in fact libkio) recurse into directories and copy files
> one by one, we can handle
> in libkio the cases like "the destination already exists, want to
> rename/overwrite/cancel?" etc.
Yes, you're right - in most cases thats the right way.

> that since kioslaves cannot ask such questions. We can also handle
> progress info
> in a central place, etc.

Right, too. For most cases. But sometimes you should give a kio-slave the
chance to handle such things itself. Even subversion has a great inbuild
control about handle such problems, eg, the subversion api itself knows a
lot about force overwriting and so on. On other hand it makes not such
sense check some stuff on clientside 'cause it contains a history so you
may recover your last operation always. And progressbar: well, a
subversion repository copy/move is somewhat faster than the recursive
creating and single copy. In that case a progressdialog will not shown
'cause not needed, on other hand I could (yes!) display a progress myself.

> But if you say it makes sense for kio_svn, which wants to copy entire
> directories
> and simply error out, or give a warning, in case of an already existing
> file or subdir,
> then we could add copyRecursive=true + moveRecursive=true, and call
> copy(kurl,kurl)... Hmm, but what if the source is from FTP? Letting the
> slave
> handle the copying itself only works if it can access the source files
> directly,
> i.e. only for file-to-svn or svn-to-svn. OK so copyRecursive would only be
> for svn-to-svn [would that also work with different repositories?].
As said: in this concrete stage copy/move from external source isn't
possible into it. we're just talking about svn:/ to svn:/.

> It seems to me that a simpler solution would be to let the slave know
> about the beginning and end of a copy, so that it can do the commit at
> that
> point.
> beginCopy() -> creates a temp dir
> mkdir()-> does a mkdir inside the temp dir
> copy() -> for each file, copy into the tempdir
>   (or get/put is used if copyFromFile=false or for remote files)
> endCopy() -> commit the stuff.
> That way it also works with FTP, SMB, etc. as source. I understand that
> this
> might be a rare case for kio_svn, but I don't want to design something in
> libkio that breaks network transparency, it would kind of defeat the point
> :)

No, no break, there you're right. but thats why I said: not from external
sources. But KIO should get a chance to say: if same protocol, let me try
it myself. If it would not work (like different repositories) the KIO may
display an error message. But this should be a decision by the KIO. If it
may use that opportunity  - so it should do. Copy/Move from/to outside eg
other protocols are different tasks - that will not work with svn the
simple way.

Hope, made somewhat clearer what I want

CU

Rajko





More information about the kfm-devel mailing list