ARCHIVE_ENTRY_PATHS(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ¦‹ 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 by archive_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 named XXX_w(). that little _w is 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 for archive_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