Clean iddb.d periodically.

This commit is contained in:
Adam Ierymenko 2017-03-08 10:18:12 -08:00
parent 04c7adea07
commit 9c1a9f984b
3 changed files with 66 additions and 0 deletions

View file

@ -119,6 +119,16 @@ public:
*/
static std::map<std::string,char> listDirectoryFull(const char *path);
/**
* Clean a directory of files whose last modified time is older than this
*
* This ignores directories, symbolic links, and other special files.
*
* @param olderThan Last modified older than timestamp (ms since epoch)
* @return Number of cleaned files or negative on fatal error
*/
static long cleanDirectory(const char *path,const uint64_t olderThan);
/**
* Delete a directory and all its files and subdirectories recursively
*