IgnorantGuru / spacefm

SpaceFM File Manager
http://ignorantguru.github.com/spacefm/
GNU General Public License v3.0
489 stars 73 forks source link

Do not delete original file on a failed move #9

Closed OmegaPhil closed 12 years ago

OmegaPhil commented 12 years ago

SpaceFM v0.7.3

Just had an issue where two large files were moved between drives - one file succeeded but one failed as the destination volume ran out of space. Instead of seeing one file in the destination and one in the source, the destination kept the corrupt copy and no files were left at the source!

Its not worth a feature request but as a Nice To Have, perhaps a free space check could be made before moves to preempt this issue.

IgnorantGuru commented 12 years ago

Confirmed - I'm surprised that this has never been reported before as the vfs code that handles this dates back to pcmanfm. I've also never encountered it despite all the tests I've run. I'll take a look at this asap.

Measuring free space accurately is almost impossible due to filesystems like btrfs. Because it would be annoying to be prevented from copying when you do in fact have enough space, this isn't done. But in this case it sounds like it's the error that isn't handled correctly.

OmegaPhil commented 12 years ago

Responding to the free space note, spacefm does 'know' this (or perhaps an approximation) as I use this figure at the bottom-left status bar when judging larger transfers etc. It would be useful say to warn the user prior to commiting the move/copy etc (another point against denying the move/copy outright would be that the user could clear some space up as the copy/move operation works).

IgnorantGuru commented 12 years ago

It couldn't be the default (on compressed filesystems, for example, you don't know how much space the file will take until it's written), but perhaps it could be made an option at some point - it would be useful in many cases, I agree. But that is unrelated as far as this bug is concerned - in no event should the original be removed until the destination is complete.

OmegaPhil commented 12 years ago

Sure, shall I fork it to another ticket?

IgnorantGuru commented 12 years ago

Up to you - I've noted it as something to look into (a list which now contains over 400 items, just to warn you), but if you'd like others' input, etc., feel free to submit an issue so it can be discussed.

Also, I'm toying with the idea of rewriting spacefm's preferences dialog to make it much more capable of handling these little options. So this kind of option would probably follow that, if and when it's done.

OmegaPhil commented 12 years ago

Done - https://github.com/IgnorantGuru/spacefm/issues/10

Always best to get these things in public space - the net knows what is/isnt being worked on then

IgnorantGuru commented 12 years ago

Updated Info: This bug should not exist in pcmanfm-mod as it was introduced in spacefm when the error control options were added.