summaryrefslogtreecommitdiff
path: root/FILEFORMAT
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2016-01-19 20:21:58 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2016-01-19 20:21:58 +0100
commit5b660adfba7b9c65f2884e27d308b490c5eec10a (patch)
treec0ab9a1be63ddb1078edaf22a6ed2e389e37fdbe /FILEFORMAT
parentddc57ddc6ca9be5c61e678edb81b946baa774982 (diff)
README: Reorder, add sections and extract stuff into FILEFORMAT file.
Diffstat (limited to 'FILEFORMAT')
-rw-r--r--FILEFORMAT42
1 files changed, 42 insertions, 0 deletions
diff --git a/FILEFORMAT b/FILEFORMAT
new file mode 100644
index 0000000..fcd3d41
--- /dev/null
+++ b/FILEFORMAT
@@ -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 big 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
+ }