From 261219d30f951b2ef688ba5c5f9b4bc4c4d53182 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Thu, 18 Sep 2014 22:36:35 +0400 Subject: [PATCH] Windows: fix wrong convertion of path from utf8 to ansi in libtorrent's create_directory (GetDataDir() returns string in correct code page) --- src/twister.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/twister.cpp b/src/twister.cpp index 24a19f21..0c347f11 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -140,8 +140,8 @@ torrent_handle startTorrentUser(std::string const &username, bool following) tparams.name = username; boost::filesystem::path torrentPath = GetDataDir() / "swarm"; tparams.save_path= torrentPath.string(); - libtorrent::error_code ec; - create_directory(tparams.save_path, ec); + boost::system::error_code ec; + boost::filesystem::create_directory(torrentPath, ec); std::string filename = combine_path(tparams.save_path, to_hex(ih.to_string()) + ".resume"); load_file(filename.c_str(), tparams.resume_data); @@ -265,10 +265,10 @@ void ThreadWaitExtIP() MilliSleep(500); } - libtorrent::error_code ec; + libtorrent::error_code ec; // libtorrent::error_code == boost::system::error_code boost::filesystem::path swarmDbPath = GetDataDir() / "swarm" / "db"; - create_directories(swarmDbPath.string(), ec); + boost::filesystem::create_directories(swarmDbPath, ec); m_swarmDb.reset(new CLevelDB(swarmDbPath.string(), 256*1024, false, false)); int listen_port = GetListenPort() + LIBTORRENT_PORT_OFFSET;