diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 25854091f..ace3ebdb3 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -318,7 +318,10 @@ bool ftController::completeFile(std::string hash) fc->mState = ftFileControl::COMPLETED; - if( moveFile(fc->mCurrentPath,fc->mDestination) ) + // I don't know how the size can be zero, but believe me, this happens, + // and it causes an error on linux because then the file may not even exist. + // + if( fc->mSize > 0 && moveFile(fc->mCurrentPath,fc->mDestination) ) fc->mCurrentPath = fc->mDestination; else fc->mState = ftFileControl::ERROR_COMPLETION; @@ -338,6 +341,10 @@ bool ftController::completeFile(std::string hash) period = 30 * 24 * 3600; /* 30 days */ flags = 0; +#ifdef CONTROL_DEBUG + std::cerr << "CompleteFile(): size = " << size << std::endl ; +#endif + doCallback = fc->mDoCallback; callbackCode = fc->mCallbackCode;