ported commit 7487 from branch 0.5.5. Seems to fix loss of config files on windows.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7548 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-09-20 19:54:04 +00:00
parent 2350837bc6
commit e18c934e21
2 changed files with 3 additions and 5 deletions

View file

@ -732,7 +732,7 @@ bool RsDirUtil::renameFile(const std::string& from, const std::string& to)
std::wstring t;
librs::util::ConvertUtf8ToUtf16(to, t);
while (!MoveFileEx(f.c_str(), t.c_str(), MOVEFILE_REPLACE_EXISTING))
while (!MoveFileEx(f.c_str(), t.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH))
#else
std::string f(from),t(to) ;
@ -1348,7 +1348,7 @@ bool RsDirUtil::renameWideFile(const std::wstring& from, const std::wstring& to)
#else
std::wstring f(from),t(to) ;
#endif
while (!MoveFileEx(f.c_str(), t.c_str(), MOVEFILE_REPLACE_EXISTING))
while (!MoveFileEx(f.c_str(), t.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH))
#else
/***** XXX TO MAKE WIDE SYSTEM CALL ******************************************************/
std::string f(from.begin(), from.end());