commit: 45cdd5bd689ca17178b09303ccfca4eb3a500fc4
parent 80de4c1338a45b0a45c34fcbfad8010a74bcc3a1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 9 Apr 2025 02:53:46 +0200
notes/tar: new, with compression autodetection section
Diffstat:
1 file changed, 35 insertions(+), 0 deletions(-)
diff --git a/notes/tar.xhtml b/notes/tar.xhtml
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+<!--#include file="/templates/head.shtml" -->
+ <title>Differences between tar(1) implementations — lanodan’s cyber-home</title>
+ </head>
+ <body>
+<!--#include file="/templates/en/nav.shtml" -->
+ <main>
+ <h1>Differences between tar(1) implementations</h1>
+
+ <h2>Autodetection of compression</h2>
+ <ul>
+ <li>libarchive and busybox autodetects for both files and pipes, without using a child process</li>
+ <li>heirloom tar autodetects for both files and pipes, with using a child process for decompression</li>
+ <li>GNU tar autodetects for both but throws an error for pipes</li>
+ </ul>
+
+ <p>
+ Testing the pipes case:
+ <ol>
+ <li>Check cat isn't a shell builtin: <code>command -v cat</code></li>
+ <li><code>cat foobar.tar.gz | tar tvf -</code></li>
+ </ol>
+ <code>cat(1)</code> used here to be sure it is pipes and not fd referring to a file.
+ </p>
+
+ <h2>See also</h2>
+ <ul>
+ <li>On the file formats side of things: <a href="https://dev.gentoo.org/~mgorny/articles/portability-of-tar-features.html">Portability of tar features - Michał Górny</a></li>
+ </ul>
+ </main>
+<!--#include file="/templates/en/footer.shtml" -->
+ </body>
+</html>