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

Review Request #103412 - Created Dec. 14, 2011 and submitted

Information
Nick Shaforostoff
kdelibs
243160
Reviewers
kdelibs
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.
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)

Issues

  • 1
  • 0
  • 0
  • 1
Description From Last Updated
Please use KFileSystemType instead of KMountPoint, it will be much faster. And yeah, given that copying to NFS will be ... David Faure David Faure
Aaron J. Seigo
Nick Shaforostoff
Aaron J. Seigo
David Faure
Commit Hook
Nick Shaforostoff
Review request changed

Status: Closed (submitted)

Loading...