SHFileOperation FO_MOVE deletes a file if the destination drive is full

Posted by Shailesh Kumar on Stack Overflow See other posts from Stack Overflow or by Shailesh Kumar
Published on 2010-05-26T13:09:27Z Indexed on 2010/05/26 13:11 UTC
Read the original article Hit count: 194

Filed under:
|
|

I had a piece of code which uses windows SHFileOperation function with FO_MOVE operation. Additional flags specified were FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT.

A particular weird behavior was observed when the destination drive was full. In this case, MOVE could not place the file in destination folder but the source file was also lost. This was highly unexpected and this caused a loss of data.

Is this the standard behavior of SHFileOperation? Can we have something like MOVE if the destination drive has space otherwise leave the file at the original place?

© Stack Overflow or respective owner

Related posts about c++

Related posts about win32