re-wrote cleanupDirectory() function. As this a cause of the slow startup.

Startup time is massively improved!

Please test on Windows!



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6757 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-09-24 15:31:15 +00:00
parent 715984249c
commit ae2df43b8a
3 changed files with 133 additions and 10 deletions

View file

@ -30,6 +30,7 @@
#include <string>
#include <list>
#include <set>
#include <stdint.h>
class RsThread;
@ -85,7 +86,9 @@ bool fileExists(const std::string& file);
bool checkFile(const std::string& filename,bool disallow_empty_file = false);
bool checkDirectory(const std::string& dir);
bool checkCreateDirectory(const std::string& dir);
bool cleanupDirectory(const std::string& dir, const std::list<std::string> &keepFiles);
bool cleanupDirectory(const std::string& dir, const std::set<std::string> &keepFiles);
bool cleanupDirectoryFaster(const std::string& dir, const std::set<std::string> &keepFiles);
bool hashFile(const std::string& filepath, std::string &name, std::string &hash, uint64_t &size);
bool getFileHash(const std::string& filepath,std::string &hash, uint64_t &size, RsThread *thread = NULL);