ARCHIVE_ENTRY_PATHS(3)
π¦ ARCHIVE_ENTRY_PATHS(3) β bestie edition π
okay so this is a page from the Library Functions Manual, and it's literally all about ARCHIVE_ENTRY_PATHS β the libarchive(3) girlies who handle path names in archive entry descriptions. if you've ever been like "wait, whose pathname is this and why is the hardlink yelling" β bestie, this is the page for you. β¨
π NAME π
archive_entry_hardlink, archive_entry_hardlink_w, archive_entry_set_hardlink, archive_entry_copy_hardlink, archive_entry_copy_hardlink_w, archive_entry_update_hardlink_utf8, archive_entry_set_link, archive_entry_copy_link, archive_entry_copy_link_w, archive_entry_update_link_utf8, archive_entry_pathname, archive_entry_pathname_w, archive_entry_set_pathname, archive_entry_copy_pathname, archive_entry_copy_pathname_w, archive_entry_update_pathname_utf8, archive_entry_sourcepath, archive_entry_copy_sourcepath, archive_entry_symlink, archive_entry_symlink_w, archive_entry_set_symlink, archive_entry_copy_symlink, archive_entry_copy_symlink_w, archive_entry_update_symlink_utf8 β
these are functions for manipulating path names in archive entry descriptions. that's the whole vibe. π
π LIBRARY π
Streaming Archive Library β link it with -larchive. no cap. π«Ά
β¨ SYNOPSIS β¨
#include <archive_entry.h>
const char *
archive_entry_hardlink(struct archive_entry *a);
const wchar_t *
archive_entry_hardlink_w(struct archive_entry *a);
void
archive_entry_set_hardlink(struct archive_entry *a, const char *path);
void
archive_entry_copy_hardlink(struct archive_entry *a, const char *path);
void
archive_entry_copy_hardlink_w(struct archive_entry *a,
const wchar_t *path);
int
archive_entry_update_hardlink_utf8(struct archive_entry *a,
const char *path);
void
archive_entry_set_link(struct archive_entry *a, const char *path);
void
archive_entry_copy_link(struct archive_entry *a, const char *path);
void
archive_entry_copy_link_w(struct archive_entry *a, const wchar_t *path);
int
archive_entry_update_link_utf8(struct archive_entry *a,
const char *path);
const char *
archive_entry_pathname(struct archive_entry *a);
const wchar_t *
archive_entry_pathname_w(struct archive_entry *a);
void
archive_entry_set_pathname(struct archive_entry *a, const char *path);
void
archive_entry_copy_pathname(struct archive_entry *a, const char *path);
void
archive_entry_copy_pathname_w(struct archive_entry *a,
const wchar_t *path);
int
archive_entry_update_pathname_utf8(struct archive_entry *a,
const char *path);
const char *
archive_entry_sourcepath(struct archive_entry *a);
void
archive_entry_copy_sourcepath(struct archive_entry *a,
const char *path);
const char *
archive_entry_symlink(struct archive_entry *a);
const wchar_t *
archive_entry_symlink_w(struct archive_entry *a);
void
archive_entry_set_symlink(struct archive_entry *a, const char *path);
void
archive_entry_copy_symlink(struct archive_entry *a, const char *path);
void
archive_entry_copy_symlink_w(struct archive_entry *a,
const wchar_t *path);
int
archive_entry_update_symlink_utf8(struct archive_entry *a,
const char *path);
πΈ DESCRIPTION πΈ
so there are five flavors of path name that archive_entry(3) is obsessed with. here's the roster, no gatekeeping:
hardlinkβ the Destination of the hardlink. it's giving "where is this actually pointing".linkβ Update only. for a symlink, it updates the destination. otherwise, it makes the entry a hardlink and alters the destination for that instead. one function, two personalities, main character energy fr fr.pathnameβ Path in the archive πsourcepathβ Path on the disk for use byarchive_read_disk(3). it lives on your filesystem, not in the archive.symlinkβ Destination of the symbolic link π₯
π§ three ways to hand over a path name π§
path names can be provided in one of three different ways, and honestly? pick your fighter:
char *β Multibyte strings in the current locale.wchar_t *β Wide character strings in the current locale. the accessor functions for these are namedXXX_w(). that little_wis the whole tell, iykyk. π- UTF-8 β Unicode strings encoded as UTF-8. these are convenience functions that update both the multibyte and wide character strings at the same time. two birds, one slay. π¦
π the lore you need π
the sourcepath is a pure filesystem concept and it is never stored in an archive directly. so true.
for that reason, it is only available as multibyte string. sorry to the wide-char girlies, that's just how it is. π
the link path is a convenience function for conditionally setting hardlink or symlink destination. it doesn't have a corresponding get accessor function β it's give, not take. periodt.
and one more thing bestie:archive_entry_set_XXX()is an alias forarchive_entry_copy_XXX(). they're the same thing. the way that set and copy are literally the same person. π
π SEE ALSO π
Debian β February 2, 2012. yeah she's an older queen, but she ATE and she's still iconic. go read archive_entry(3) next bestie, ily, bye!! πβ¨ππ¦πΈπ«Άππβ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2010 Joerg Sonnenberger
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms