th_set_from_stat(3)
β¨ th_set_from_stat β set fields of a tar file header β¨
okay bestie so this is th_set_from_stat(3), a C library call from the libtar girlies π it's all about filling in the fields of a tar file header, and honestly? it's giving "let me do your homework for you" energy.
πΈ SYNOPSIS πΈ
#include <libtar.h>
void th_set_from_stat(TAR *t, struct stat *s);
void th_set_type(TAR *t, mode_t mode);
void th_set_path(TAR *t, char *pathname);
void th_set_link(TAR *t, char *linkname);
void th_set_device(TAR *t, dev_t device);
void th_set_user(TAR *t, uid_t uid);
void th_set_group(TAR *t, gid_t gid);
void th_set_mode(TAR *t, mode_t mode);
void th_set_mtime(TAR *t, time_t fmtime);
void th_set_size(TAR *t, off_t fsize);
void th_finish(TAR *t);
π VERSION π
This man page documents version 1.2 of libtar. no cap. β¨
π DESCRIPTION π
so the whole th_set_*() friend group is here to set individual fields of the current tar header that's living inside the TAR handle t. one field each, they don't do group projects. π«Ά
special shoutout: th_set_user() and th_set_group() are the overachievers β they set both the numeric user/group ID fields and the user/group name text fields. the other functions? they set only the one field they're literally named after. iconic, minimal, focused. periodt. π
now for the main character, th_set_from_stat(): it pulls the other th_set_*() functions together like the group chat and sets all of the fields at once, based on the data you hand it in the argument s. one call, whole header, slay. β¨
and then there's th_finish() π β it sets the appropriate constants for the magic and version fields, then calculates the header checksum and fills in the checksum field. it's the "okay we're done here, wrap it up" function fr fr.
π₯ SEE ALSO π₯
and that's the whole page, bestie π thanks for reading my little Unix yap session.
this one came to you from the University of Illinois, dated Jan 2001, living under the th_set_from_stat(3) header in the C Library Calls section. mwah. πβ¨
π¦ where this page comes from
- arch rolling: libtar 1.2.20-8 Β· BSD
- 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms