Remove stat file cache dir if specified del_cache - #337

This commit is contained in:
Takeshi Nakatani
2016-02-06 18:59:13 +00:00
parent 87faed0d04
commit 150b83f61e
3 changed files with 26 additions and 6 deletions

View File

@ -124,6 +124,23 @@ bool CacheFileStat::DeleteCacheFileStat(const char* path)
return true;
}
// [NOTE]
// If remove stat file directory, it should do before removing
// file cache directory.
//
bool CacheFileStat::DeleteCacheFileStatDirectory(void)
{
string top_path = FdManager::GetCacheDir();
if(top_path.empty() || bucket.empty()){
return true;
}
top_path += "/.";
top_path += bucket;
top_path += ".stat";
return delete_files_in_dir(top_path.c_str(), true);
}
//------------------------------------------------
// CacheFileStat methods
//------------------------------------------------