bool FileUtils::removeDirectory(const std::string& path)
{
if (path.size() > 0 && path[path.size() - 1] != '/')
{
CCLOGERROR("Fail to remove directory, path must terminate with '/': %s", path.c_str());
return false;
}
std::string command = "rm -r ";
// Path may include space.
command += "\"" + path + "\"";
if (popen(command.c_str(),"r"))
return true;
else
return false;
}