remove.cc
#include <string>
#include <boost/filesystem.hpp>
int main()
{
std::string s = "a/b";
boost::filesystem::remove_all(s);
return 0;
}
ls -R a/b
a/b:
c d
./a.out
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::remove: Directory not empty: "a"
Abort
=============================================
uintmax_t remove_all(const path& p);
uintmax_t remove_all(const path& p, system::error_code& ec);
Effects: Recursively deletes the contents of p if it exists, then deletes file p itself, as if by POSIX remove().
==============================================
我想念什么吗?