tar_extract_all(3)
β¨ tar_extract_all(3) β¨
okay bestie, buckle up π this is a C Library Calls page from the libtar crew, and it's literally the high-level tar archive manipulation trio. three little functions that do the heavy lifting so you don't have to π
πΈ NAME πΈ
tar_extract_all, tar_extract_glob, tar_append_tree β high-level tar archive manipulation functions π¦
π SYNOPSIS π
#include <libtar.h>
int tar_extract_all(TAR *t, char *prefix);
int tar_extract_glob(TAR *t, char *globname, char *prefix);
int tar_append_tree(TAR *t, char *realdir, char *savedir);
π VERSION π
this man page documents version 1.2 of libtar. periodt, that's the one, no cap π
π DESCRIPTION π
so here's the tea, three functions, three vibes, all iconic π
tar_extract_all()β extracts all the files from the tar archive that's associated with theTARhandlet, and drops them into the path named by theprefixargument. every single file. the whole squad. no one left behind π«Άtar_extract_glob()β extracts all files that match the given glob patternglobnamefrom the tar archive associated with theTARhandlet, into the path named by theprefixargument. it's giving selective, it's giving picky, and honestly? we respect it πtar_append_tree()β appends all files from the directory tree named byrealdirto the tar archive associated with theTARhandlet. and here's the cute part: the pathnames stored in the tar archive get modified by replacingrealdirwithsavedir, so that when the files get extracted they land insavedirinstead. it's a lil name swap, a lil glow-up, main character energy β¨
π₯ RETURN VALUES π₯
on successful completion, these functions will return 0 ππ
on failure, they will return -1 and set errno to an appropriate value. yeah, it's a -1 situation, we've all been there π
π ERRORS π
these functions will fail under the same conditions that the tar_skip_regfile(), tar_extract_regfile(), opendir(), lstat(), or tar_append_file() functions fail. so if you wanna know exactly why it went sideways, that's your reading list, bestie π
π¦ SEE ALSO π¦
fr fr, go read the SEE ALSO list before you start blaming yourself. it's not you, it's the errno π
and that's a wrap on this one, bestie πΈ this whole page is brought to you by the University of Illinois, dated Jan 2001 β yes, 2001, the lore is ancient but the code still ate πβ¨ bye pookie π
π¦ where this page comes from
- arch rolling: libtar 1.2.20-8 Β· BSD
- debian bookworm: libtar-dev 1.2.20-8+deb12u1
- fedora 43: libtar-devel 1.2.20-34.fc43 Β· MIT
- fedora 43: libtar-devel 1.2.20-34.fc43 Β· MIT
- fedora 44: libtar-devel 1.2.20-35.fc44 Β· MIT
- fedora 44: libtar-devel 1.2.20-35.fc44 Β· MIT
- nixos 26.05: libtar 1.2.20
- nixpkgs unstable: libtar 1.2.20
- ubuntu jammy: libtar-dev 1.2.20-8
- ubuntu jammy: libtar-dev 1.2.20-8ubuntu0.22.04.1
- ubuntu noble: libtar-dev 1.2.20-8.1build1
- ubuntu noble: libtar-dev 1.2.20-8.1ubuntu0.24.04.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms