Review Request: check if enough disk space available before even starting to copy each file

Aaron J. Seigo aseigo at kde.org
Fri Dec 16 11:35:26 GMT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103412/#review8996
-----------------------------------------------------------


this whole file needs a reformat into kdelibs style, though that's out of scope for this patch .. comments inline below.


kio/kio/copyjob.cpp
<http://git.reviewboard.kde.org/r/103412/#comment7465>

    note that KDiskFreeSpaceInfo can block for significant periods of time in certain cases; we've found this to be the case where the mount point being queried was a network drive that is no longer available (temporarily or permanently; disruption of network access triggers this case nicely). this can result in delays on the order of 15-30s on many systems.
    
    as such, in plasma we've moved usage of KDiskFreeSpaceInfo into a separate thread on its own.
    
    i'm not sure if this would end up a concern here (perhaps one can only copy to locations that are accessible?), but something to note.



kio/kio/copyjob.cpp
<http://git.reviewboard.kde.org/r/103412/#comment7466>

    of course, this won't help much in the case where there is more than one copy job happening (in or out of KIO). though i suppose it will end up catching more cases than are caught now (e.g. none)


- Aaron J. Seigo


On Dec. 14, 2011, 2:56 p.m., Nick Shaforostoff wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103412/
> -----------------------------------------------------------
> 
> (Updated Dec. 14, 2011, 2:56 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Description
> -------
> 
> this is simple fix for 243160. It gets free space info for the dst partition, then after each successful file copy it decreases an internally kept m_freeSpace value.
> 
> this will help us avoid situations when user copies a 4gb long file onto his disk, then finds out it has not enough space available.
> 
> i hope that i correctly understood kio copy job mechanism and done error reporting right.
> 
> TODO (from what was asked in the bug):
> *checking for single file size limit on vfat.
> *if the total size is larger than free space, warn user beforehand immediately
> (right now it does the copying until it finds that the next file cannot be copied completely)
> both these require new dialogs with user visible strings and are subject to be added after 4.8.
> 
> 
> also as a bonus i changed m_overwriteList to be qset instead of qlist to make lookup operations faster.
> 
> 
> This addresses bug 243160.
>     http://bugs.kde.org/show_bug.cgi?id=243160
> 
> 
> Diffs
> -----
> 
>   kio/kio/copyjob.cpp eff7825 
> 
> Diff: http://git.reviewboard.kde.org/r/103412/diff/diff
> 
> 
> Testing
> -------
> 
> files get copied fine. if i copy a bunch of files including one big file
> (created with dd if=/dev/zero of=file.out bs=1MB count=300), then the copying process stops when it gets to this big file (i have small disk on my virtual machine, only 400 mb free)
> 
> 
> Thanks,
> 
> Nick Shaforostoff
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20111216/ecae6456/attachment.htm>


More information about the kde-core-devel mailing list