23 #include <boost/filesystem.hpp>
30 namespace fs = boost::filesystem;
32 TransientDirectory::TransientDirectory():
40 if (boost::filesystem::exists(m_path))
41 BOOST_THROW_EXCEPTION(FileError());
43 if (!fs::create_directories(m_path))
44 BOOST_THROW_EXCEPTION(FileError());
50 boost::system::error_code ec;
51 fs::remove_all(m_path, ec);
59 this_thread::sleep_for(chrono::milliseconds(10));
62 fs::remove_all(m_path, ec);
65 cwarn <<
"Failed to delete directory '" << m_path <<
"': " << ec.message();