mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-15 10:18:39 -09:00
dir_export.c: Add timestamp to meta-data
This commit is contained in:
parent
b6e4092ea7
commit
eeff908b0c
1 changed files with 6 additions and 2 deletions
|
|
@ -28,6 +28,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
|
||||||
static FILE *stream;
|
static FILE *stream;
|
||||||
|
|
@ -132,8 +133,11 @@ static int item(struct dir *item) {
|
||||||
|
|
||||||
/* File header.
|
/* File header.
|
||||||
* TODO: Add scan options? */
|
* TODO: Add scan options? */
|
||||||
if(!stack.top)
|
if(!stack.top) {
|
||||||
fputs("[1,0,{\"progname\":\""PACKAGE"\",\"progver\":\""PACKAGE_VERSION"\"}", stream);
|
fputs("[1,0,{\"progname\":\""PACKAGE"\",\"progver\":\""PACKAGE_VERSION"\",\"timestamp\":", stream);
|
||||||
|
output_int((uint64_t)time(NULL));
|
||||||
|
fputc('}', stream);
|
||||||
|
}
|
||||||
|
|
||||||
fputs(",\n", stream);
|
fputs(",\n", stream);
|
||||||
if(item->flags & FF_DIR)
|
if(item->flags & FF_DIR)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue