be more verbose while deleting items in browser

This commit is contained in:
Andrzej Rybczak
2009-06-06 08:24:05 +02:00
parent 12a7d847c1
commit 25554ed100
2 changed files with 9 additions and 6 deletions

View File

@@ -20,6 +20,7 @@
#include <dirent.h>
#include <sys/stat.h>
#include <cerrno>
#include <cstring>
#include <algorithm>
@@ -536,7 +537,10 @@ void Browser::ClearDirectory(const std::string &path) const
lstat(full_path.c_str(), &file_stat);
if (S_ISDIR(file_stat.st_mode))
ClearDirectory(full_path);
remove(full_path.c_str());
if (remove(full_path.c_str()) == 0)
ShowMessage("Deleting \"%s\"...", full_path.c_str());
else
ShowMessage("Couldn't remove \"%s\": %s", full_path.c_str(), strerror(errno));
}
closedir(dir);
}