How can I copy a directory using Boost Filesystem
问题 How can I copy a directory using Boost Filesystem? I have tried boost::filesystem::copy_directory() but that only creates the target directory and does not copy the contents. 回答1: bool copyDir( boost::filesystem::path const & source, boost::filesystem::path const & destination ) { namespace fs = boost::filesystem; try { // Check whether the function call is valid if( !fs::exists(source) || !fs::is_directory(source) ) { std::cerr << "Source directory " << source.string() << " does not exist or