Implement list command - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 9fef9d0082f1cfb9dc1883482f45ba3f84bc5e9c
DIR parent 5bebcbec44537372fcd4e178fdc4057d6d04f783
HTML Author: sin <sin@2f30.org>
Date: Tue, 20 Mar 2018 18:39:12 +0000
Implement list command
Diffstat:
M dedup.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
DIR diff --git a/dedup.c b/dedup.c
@@ -301,6 +301,20 @@ dump_index(void)
}
void
+list(void)
+{
+ uint64_t i;
+
+ lseek(ifd, sizeof(enthdr), SEEK_SET);
+ for (i = 0; i < enthdr.nents; i++) {
+ struct ent ent;
+ read(ifd, &ent, sizeof(ent));
+ dump_md(ent.md, sizeof(ent.md));
+ putchar('\n');
+ }
+}
+
+void
usage(void)
{
fprintf(stderr, "usage: %s [-lv] [-e id]\n", argv0);
@@ -330,7 +344,7 @@ main(int argc, char *argv[])
init();
if (lflag) {
- dump_index();
+ list();
return 0;
}