KIO and KFM and copy/move/delete operations

Thiago Macieira thiago at kde.org
Mon Oct 17 22:46:42 BST 2005


David Faure wrote:
>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 :)

How about adding a call to "commit" after whatever operation is done, just 
like svn and just like transactional databases? There's no need to add 
special begin* methods in that case, and also no need to add per-method 
ends (endCopy, endMove, endRename, endDelete). I don't see any use for it 
right now, but we could also invent a rollback() method.

So, for existing ioslaves, a copy/move's commit would be a no-op, while 
for svn it would really commit. For recursive-deleting ioslaves, the 
delete method would be called once for each dir/file entry, but the 
ioslave would hold the actual delete command until the final commit() is 
sent.

This way, we simplify the entries in .protocol files. The drawback is the 
continuous firing of commands into the ioslave. Hmm... but it would also 
cause listDirs and possibly stats in recursive-deleting ioslaves, which 
isn't needed.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

2. Tó cennan his weorc gearu, ymbe se circolwyrde, wearð se cægbord and se 
leohtspeccabord, and þa mýs cómon lator. On þone dæg, he hine reste.
-------------- 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/20051017/f7cc61c6/attachment.sig>


More information about the kfm-devel mailing list