.part files and multiple io-slaves...

Dawit A. adawit at kde.org
Sat Feb 21 16:09:15 GMT 2004


Hi,

There is a nasty issue with partial download marking (.part files) and 
multiple io-slaves downloading the same resource. If you make a mistake and 
copy/paste or drag/drop the same file into the same destination, both 
io-slaves will attempt to download the same resource. The end result is two 
io-slaves downloading the same file and overwritting each other.

The attached patch attempts to resolve this by doing another stat after 
determining whether we can resume or not, and comparing the size of of the 
partial file before and after. If the size is growing, we assume that another 
process is downloading/uploading the same file. Another way would be to start 
using lock files and checking those to make sure we detect ongoing 
dowloads/uploads.  BTW, I only picked the COULD_NOT_WRITE error message 
because I only wanted to test the single file download case. To fix the 
problem properly I think we need a new error message for this so that the 
user can be prompted to "Skip/Skip All" in case of multi-file downloads. 
FILE_ALREADY_EXISTS does not cut it here since it will give the user a choice 
to overwrite which we do not want in this case...

-- 
Regards,
Dawit A.
"Preach what you practice, practice what you preach"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-20040221-1.diff
Type: text/x-diff
Size: 1024 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040221/e32faa03/attachment.diff>


More information about the kfm-devel mailing list