From dc48cfa2c3a8146bfc62e527ff75302e47da49ed Mon Sep 17 00:00:00 2001 From: bri Date: Fri, 8 Feb 2013 10:58:56 +0000 Subject: [PATCH] MPV : Remove temporary directory if the removed temporary file is the last one in it --- src/Container/SALOME_DataContainer_i.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Container/SALOME_DataContainer_i.cxx b/src/Container/SALOME_DataContainer_i.cxx index 965b4047c..6bbc41b0b 100644 --- a/src/Container/SALOME_DataContainer_i.cxx +++ b/src/Container/SALOME_DataContainer_i.cxx @@ -86,11 +86,15 @@ Engines::TMPFile* Engines_DataContainer_i::get() aFile.close(); // remove file after it converted to a stream + // also remove directory of the file if it is empty if (myRemoveAfterGet) { + string aDirName = myURL.substr(0, myURL.find_last_of("/\\")); #ifdef WIN32 DeleteFile(myURL.c_str()); + RemoveDirectory(aDirName.c_str()); #else unlink(myURL.c_str()); + rmdir(aDirName.c_str()); #endif } } -- 2.39.2