Use boost::filesystem for "rm -rf".

Replaces a system() call (which was a portability problem) and fixes,
en passant, a warning about its return value being ignored.
This commit is contained in:
Jeroen Vermeulen 2015-03-29 18:33:58 +07:00
parent 789a2e2bc3
commit b124d99330

View File

@ -1,5 +1,7 @@
// vim:tabstop=2
#include <cstdlib>
#include <boost/filesystem.hpp>
#include "PhraseDictionaryTransliteration.h"
#include "moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.h"
#include "moses/DecodeGraph.h"
@ -104,9 +106,7 @@ void PhraseDictionaryTransliteration::GetTargetPhraseCollection(InputPath &input
// clean up temporary files
remove(inFile.c_str());
cmd = "rm -rf " + outDir;
system(cmd.c_str());
boost::filesystem::remove_all(outDir);
}
}