X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=scandir.cc;h=4f8495599e4135b8380843bc439ca89dfe951b10;hb=6cefd6f6bb0c87697930ec6c378353a289f1c867;hp=d5a8c86c389ec2a95e2d0814bf0e0ac68622fafd;hpb=6e0eba0d28ca8d73f199e7b4240b9da2cc96c741;p=cumulus.git diff --git a/scandir.cc b/scandir.cc index d5a8c86..4f84955 100644 --- a/scandir.cc +++ b/scandir.cc @@ -257,6 +257,7 @@ void dump_inode(const string& path, // Path within snapshot printf("%s\n", path.c_str()); file_info["mode"] = encode_int(stat_buf.st_mode & 07777, 8); + file_info["ctime"] = encode_int(stat_buf.st_ctime); file_info["mtime"] = encode_int(stat_buf.st_mtime); file_info["user"] = encode_int(stat_buf.st_uid); file_info["group"] = encode_int(stat_buf.st_gid); @@ -273,11 +274,12 @@ void dump_inode(const string& path, // Path within snapshot if (stat_buf.st_nlink > 1 && (stat_buf.st_mode & S_IFMT) != S_IFDIR) { file_info["links"] = encode_int(stat_buf.st_nlink); - file_info["inode"] = encode_int(major(stat_buf.st_dev)) - + "/" + encode_int(minor(stat_buf.st_dev)) - + "/" + encode_int(stat_buf.st_ino); } + file_info["inode"] = encode_int(major(stat_buf.st_dev)) + + "/" + encode_int(minor(stat_buf.st_dev)) + + "/" + encode_int(stat_buf.st_ino); + char inode_type; switch (stat_buf.st_mode & S_IFMT) { @@ -664,13 +666,16 @@ int main(int argc, char *argv[]) tss = new TarSegmentStore(backup_dest, db); - metawriter = new MetadataWriter(tss); - /* Initialize the stat cache, for skipping over unchanged files. */ statcache = new StatCache; statcache->Open(localdb_dir.c_str(), desc_buf, backup_scheme.size() ? backup_scheme.c_str() : NULL); + metawriter = new MetadataWriter(tss, localdb_dir.c_str(), desc_buf, + backup_scheme.size() + ? backup_scheme.c_str() + : NULL); + scanfile(".", false); ObjectReference root_ref = metawriter->close();