From 527214c7ee648cccbe4abbb11bde298b7b52141b Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Mon, 16 May 2022 09:44:30 +0100 Subject: Label file Format 0 explicitly as Format 0 --- FILEFORMAT_0 | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 FILEFORMAT_0 (limited to 'FILEFORMAT_0') diff --git a/FILEFORMAT_0 b/FILEFORMAT_0 new file mode 100644 index 0000000..0fddf85 --- /dev/null +++ b/FILEFORMAT_0 @@ -0,0 +1,42 @@ +Version 0 +--------- + +Following sections explain internals of metastore file (.metadata). + + +### Data types + + CSTRING = NUL-terminated binary string + BSTRING(N) = binary string of length N + INT(N) = N byte integer in little-endian byte order + + +### File layout + + HEADER + N * ENTRY + + +### HEADER format + + BSTRING(10) - Magic header - "MeTaSt00r3" + BSTRING(8) - Version - "\0\0\0\0\0\0\0\0" (currently) + + +### ENTRY format + + CSTRING - Path (absolute or relative) + CSTRING - Owner (owner name, not uid) + CSTRING - Group (group name, not gid) + + INT(8) - Mtime (seconds) + INT(8) - Mtime (nanoseconds) + INT(2) - Mode (st_mode from struct stat st_mode AND 0177777, + i.e. unix permissions and type of file) + + INT(4) - num_xattrs + FOR (i = 0; i < num_xattrs; i++) { + CSTRING - xattr name + INT(4) - xattrlen + BSTRING(xattrlen) - xattr value + } -- cgit v1.2.1