From da88e49bae2f3fecff623f52c20bf994b653583e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 29 Mar 2021 15:36:16 -0700 Subject: [PATCH] add new examples --- docs/parsers/stat.md | 76 +++++++++++++++++++++++++++++--------------- jc/parsers/stat.py | 22 +++++++++++-- 2 files changed, 69 insertions(+), 29 deletions(-) diff --git a/docs/parsers/stat.md b/docs/parsers/stat.md index 86b08e05..c6cef34f 100644 --- a/docs/parsers/stat.md +++ b/docs/parsers/stat.md @@ -41,7 +41,15 @@ Examples: "access_time": "2019-11-14 08:18:03.509681766 +0000", "modify_time": "2019-06-06 22:28:15.000000000 +0000", "change_time": "2019-08-12 17:21:29.521945390 +0000", - "birth_time": null + "birth_time": null, + "access_time_epoch": 1573748283, + "access_time_epoch_utc": 1573719483, + "modify_time_epoch": 1559885295, + "modify_time_epoch_utc": 1559860095, + "change_time_epoch": 1565655689, + "change_time_epoch_utc": 1565630489, + "birth_time_epoch": null, + "birth_time_epoch_utc": null }, { "file": "/bin/btrfs", @@ -61,7 +69,15 @@ Examples: "access_time": "2019-11-14 08:18:28.990834276 +0000", "modify_time": "2018-03-12 23:04:27.000000000 +0000", "change_time": "2019-08-12 17:21:29.545944399 +0000", - "birth_time": null + "birth_time": null, + "access_time_epoch": 1573748308, + "access_time_epoch_utc": 1573719508, + "modify_time_epoch": 1520921067, + "modify_time_epoch_utc": 1520895867, + "change_time_epoch": 1565655689, + "change_time_epoch_utc": 1565630489, + "birth_time_epoch": null, + "birth_time_epoch_utc": null }, ... ] @@ -108,7 +124,7 @@ Examples: "change_time": "2019-08-12 17:21:29.545944399 +0000", "birth_time": null }, - .. + ... ] @@ -135,29 +151,37 @@ Returns: [ { - "file": string, - "link_to" string, - "size": integer, - "blocks": integer, - "io_blocks": integer, - "type": string, - "device": string, - "inode": integer, - "links": integer, - "access": string, - "flags": string, - "uid": integer, - "user": string, - "gid": integer, - "group": string, - "access_time": string, # - = null - "modify_time": string, # - = null - "change_time": string, # - = null - "birth_time": string, # - = null - "unix_device": integer, - "rdev": integer, - "block_size": integer, - "unix_flags": string + "file": string, + "link_to" string, + "size": integer, + "blocks": integer, + "io_blocks": integer, + "type": string, + "device": string, + "inode": integer, + "links": integer, + "access": string, + "flags": string, + "uid": integer, + "user": string, + "gid": integer, + "group": string, + "access_time": string, # - = null + "access_time_epoch": integer, # naive timestamp + "access_time_epoch_utc": integer, # timezone-aware timestamp + "modify_time": string, # - = null + "modify_time_epoch": integer, # naive timestamp + "modify_time_epoch_utc": integer, # timezone-aware timestamp + "change_time": string, # - = null + "change_time_epoch": integer, # naive timestamp + "change_time_epoch_utc": integer, # timezone-aware timestamp + "birth_time": string, # - = null + "birth_time_epoch": integer, # naive timestamp + "birth_time_epoch_utc": integer, # timezone-aware timestamp + "unix_device": integer, + "rdev": integer, + "block_size": integer, + "unix_flags": string } ] diff --git a/jc/parsers/stat.py b/jc/parsers/stat.py index 4bd1e81d..813bf2d7 100644 --- a/jc/parsers/stat.py +++ b/jc/parsers/stat.py @@ -39,7 +39,15 @@ Examples: "access_time": "2019-11-14 08:18:03.509681766 +0000", "modify_time": "2019-06-06 22:28:15.000000000 +0000", "change_time": "2019-08-12 17:21:29.521945390 +0000", - "birth_time": null + "birth_time": null, + "access_time_epoch": 1573748283, + "access_time_epoch_utc": 1573719483, + "modify_time_epoch": 1559885295, + "modify_time_epoch_utc": 1559860095, + "change_time_epoch": 1565655689, + "change_time_epoch_utc": 1565630489, + "birth_time_epoch": null, + "birth_time_epoch_utc": null }, { "file": "/bin/btrfs", @@ -59,7 +67,15 @@ Examples: "access_time": "2019-11-14 08:18:28.990834276 +0000", "modify_time": "2018-03-12 23:04:27.000000000 +0000", "change_time": "2019-08-12 17:21:29.545944399 +0000", - "birth_time": null + "birth_time": null, + "access_time_epoch": 1573748308, + "access_time_epoch_utc": 1573719508, + "modify_time_epoch": 1520921067, + "modify_time_epoch_utc": 1520895867, + "change_time_epoch": 1565655689, + "change_time_epoch_utc": 1565630489, + "birth_time_epoch": null, + "birth_time_epoch_utc": null }, ... ] @@ -106,7 +122,7 @@ Examples: "change_time": "2019-08-12 17:21:29.545944399 +0000", "birth_time": null }, - .. + ... ] """ import shlex