]> git.seodisparate.com - SimpleArchiver/commitdiff
Update file_format.md
authorStephen Seo <seo.disparate@gmail.com>
Thu, 27 Jun 2024 01:36:06 +0000 (10:36 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 27 Jun 2024 01:36:06 +0000 (10:36 +0900)
Add support for per-file compressing by storing the
compressor/decompressor commands in the per-file header part of the
.simplearchive.

file_format.md

index 0a1ee8cb35db856c941c3c02ac2aa402bc7e08cb..c563124935c607237570051c2e6cad270c350ee2 100644 (file)
@@ -18,8 +18,16 @@ For each file:
 
 1. 2 bytes is 16-bit unsigned integer "filename length" in big-endian.
 2. X bytes of filename (defined by previous value).
-3. 8 bytes 64-bit unsigned integer "location of filename in this archive file".
-4. 8 bytes 64-bit unsigned integer "size of filename in this archive file".
+3. 2 bytes is 16-bit unsigned integer "compressor cmd+args" in big-endian.
+4. X bytes of "compressor cmd+args" (defined by previous value).
+5. 2 bytes is 16-bit unsigned integer "decompressor cmd+args" in big-endian.
+6. X bytes of "decompressor cmd+args" (defined by previous value).
+7. 8 bytes 64-bit unsigned integer "location of filename in this archive file".
+8. 8 bytes 64-bit unsigned integer "size of filename in this archive file".
+
+Note that if archiving without compressor/decompressor, the byte values for
+them will be 0 and there will be no strings for the compressor/decompressor
+commands (lines 4 and 6 in previous per-file entry will not exist).
 
 The remaining bytes in the file are the files to be included in the archive file
 concatenated together. Their locations and sizes should match what was listed