The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

notes: tar pop quiz

Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso ca61231d a38a24f3

+37 -1
+1 -1
Brewfile.lock.json
··· 731 731 "GCC": "11.4.0" 732 732 }, 733 733 "Ubuntu 22.04.3 LTS (jammy)": { 734 - "HOMEBREW_VERSION": "4.3.6", 734 + "HOMEBREW_VERSION": "4.3.17", 735 735 "HOMEBREW_PREFIX": "/home/linuxbrew/.linuxbrew", 736 736 "Homebrew/homebrew-core": "api", 737 737 "GCC": "11.4.0"
+36
lume/src/notes/2024/pop-quiz-tar.mdx
··· 1 + --- 2 + title: "Pop quiz: what is wrong with this tar command?" 3 + date: 2024-08-19 4 + desc: "It's stupider than you think" 5 + hero: 6 + ai: "Flux [dev]" 7 + file: laptop-anger 8 + prompt: "A green haired anime woman with green eyes and very long hair angrily typing on a laptop, headphones, seattle, space needle, black hoodie, best quality, coffee shop" 9 + social: true 10 + --- 11 + 12 + Pop quiz: what is wrong with this tar command? 13 + 14 + ```sh 15 + tar cf ../iosevka-iaso.tgz . 16 + ``` 17 + 18 + <Conv name="Aoi" mood="wut"> 19 + That looks fine to me? You're creating a tarball in the parent directory with 20 + the contents of the current working directory. What's the problem? 21 + </Conv> 22 + 23 + ```sh 24 + $ tar xzf iosevka-iaso.tgz 25 + gzip: not a compressed stream 26 + ``` 27 + 28 + The thing I messed up was not adding `z` to the tarball creation command. I needed to do: 29 + 30 + ```sh 31 + tar czf ../iosevka-iaso.tgz . 32 + ``` 33 + 34 + This happens because GNU tar looks at file extensions to try to determine the user's intent. If you do `tar xf foo.tgz` or `tar xf foo.tar.gz`, it will invoke gzip to decompress the tarball for you. This is intended behavior, but that same logic doesn't run when you create a tarball. 35 + 36 + I lost 15 minutes to this today and feel that I need to let y'all know so you can learn from my suffering.