logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/

tar.xhtml (1235B)


  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <!--#include file="/templates/head.shtml" -->
  5. <title>Differences between tar(1) implementations — lanodan’s cyber-home</title>
  6. </head>
  7. <body>
  8. <!--#include file="/templates/en/nav.shtml" -->
  9. <main>
  10. <h1>Differences between tar(1) implementations</h1>
  11. <h2>Autodetection of compression</h2>
  12. <ul>
  13. <li>libarchive and busybox autodetects for both files and pipes, without using a child process</li>
  14. <li>heirloom tar autodetects for both files and pipes, with using a child process for decompression</li>
  15. <li>GNU tar autodetects for both but throws an error for pipes</li>
  16. </ul>
  17. <p>
  18. Testing the pipes case:
  19. <ol>
  20. <li>Check cat isn't a shell builtin: <code>command -v cat</code></li>
  21. <li><code>cat foobar.tar.gz | tar tvf -</code></li>
  22. </ol>
  23. <code>cat(1)</code> used here to be sure it is pipes and not fd referring to a file.
  24. </p>
  25. <h2>See also</h2>
  26. <ul>
  27. <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>
  28. </ul>
  29. </main>
  30. <!--#include file="/templates/en/footer.shtml" -->
  31. </body>
  32. </html>