/* Initialize the stat cache, for skipping over unchanged files. */
statcache = new StatCache;
- statcache->Open(localdb_dir.c_str(), desc_buf);
+ statcache->Open(localdb_dir.c_str(), desc_buf,
+ backup_scheme.size() ? backup_scheme.c_str() : NULL);
scanfile(".", false);
return pathcmp(slash1 + 1, slash2 + 1);
}
-void StatCache::Open(const char *path, const char *snapshot_name)
+void StatCache::Open(const char *path, const char *snapshot_name,
+ const char *snapshot_scheme)
{
oldpath = path;
oldpath += "/statcache";
+ if (snapshot_scheme != NULL)
+ oldpath = oldpath + "-" + snapshot_scheme;
newpath = oldpath + "." + snapshot_name;
oldcache = new ifstream(oldpath.c_str());
class StatCache {
public:
- void Open(const char *path, const char *snapshot_name);
+ void Open(const char *path, const char *snapshot_name,
+ const char *snapshot_scheme);
void Close();
bool Find(const std::string &path, const struct stat *stat_buf);
void Save(const std::string &path, struct stat *stat_buf,