From b124d99330a53d75f3bfe7d521d8f571a138e090 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Sun, 29 Mar 2015 18:33:58 +0700 Subject: [PATCH] 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. --- moses/TranslationModel/PhraseDictionaryTransliteration.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moses/TranslationModel/PhraseDictionaryTransliteration.cpp b/moses/TranslationModel/PhraseDictionaryTransliteration.cpp index ce5ac121c..dc828d3f5 100644 --- a/moses/TranslationModel/PhraseDictionaryTransliteration.cpp +++ b/moses/TranslationModel/PhraseDictionaryTransliteration.cpp @@ -1,5 +1,7 @@ // vim:tabstop=2 #include +#include + #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); } }