diff options
author | Yorhel <git@yorhel.nl> | 2012-09-07 09:37:20 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2012-09-07 09:37:20 +0200 |
commit | eeff908b0c01777657d70716771616d25bfee7a8 (patch) | |
tree | 37a608b35e8c35fbd4d1558e87f7d8939d4055b7 | |
parent | b6e4092ea7f5de6addb19c2aa30ed83e33376287 (diff) |
dir_export.c: Add timestamp to meta-data
-rw-r--r-- | src/dir_export.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dir_export.c b/src/dir_export.c index 74efde5..93fcab4 100644 --- a/src/dir_export.c +++ b/src/dir_export.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <time.h> static FILE *stream; @@ -132,8 +133,11 @@ static int item(struct dir *item) { /* File header. * TODO: Add scan options? */ - if(!stack.top) - fputs("[1,0,{\"progname\":\""PACKAGE"\",\"progver\":\""PACKAGE_VERSION"\"}", stream); + if(!stack.top) { + fputs("[1,0,{\"progname\":\""PACKAGE"\",\"progver\":\""PACKAGE_VERSION"\",\"timestamp\":", stream); + output_int((uint64_t)time(NULL)); + fputc('}', stream); + } fputs(",\n", stream); if(item->flags & FF_DIR) |