Wallet backup OS-dependent path fix

This commit is contained in:
crowning- 2015-04-11 14:25:47 +02:00
parent 91bcad1d1f
commit 2b040d1e48

View File

@ -729,9 +729,12 @@ bool AppInit2(boost::thread_group& threadGroup)
if (filesystem::exists(backupDir))
{
std::string dateTimeStr = DateTimeStrFormat(".%Y-%m-%d-%H.%M", GetTime());
std::string backupDirStr = backupDir.string() + boost::filesystem::path::preferred_separator + strWalletFile;
std::string backupDirStr = backupDir.string();
backupDirStr += "/" + strWalletFile;
boost::filesystem::path sourceFile = strWalletFile;
boost::filesystem::path backupFile = backupDirStr + dateTimeStr;
backupFile.make_preferred();
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);