bool copy_file(const path & from_p, const path & to_p, bool overwrite) { bool ret = CopyFileA(from_p.string().c_str(), to_p.string().c_str(), !overwrite) == TRUE; if(!ret) { LogWarning << "CopyFileA(" << from_p << ", " << to_p << ", " << !overwrite << ") failed! " << getLastErrorString(); } else { update_last_write_time(to_p); } return ret; }
bool copy_file(const path & from_p, const path & to_p, bool overwrite) { bool ret = CopyFileW(platform::WideString(from_p.string()), platform::WideString(to_p.string()), !overwrite) == TRUE; if(!ret) { LogWarning << "CopyFile(" << from_p << ", " << to_p << ", " << !overwrite << ") failed: " << platform::getErrorString(); } else { update_last_write_time(to_p); } return ret; }