tar_extract_all(3)

tar_extract_all3

High-level tar archive manipulation functions

Usage

#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.

Overview

The tar_extract_all() function extracts all files from the tar archive associated with the TAR handle t into the path named by the prefix argument.

The tar_extract_glob() function extracts all files matching the given glob pattern from the tar archive associated with the TAR handle t into the path named by the prefix argument.

The tar_append_tree() function appends all files from the directory tree named by realdir to the tar archive associated with the TAR handle t. The pathnames stored in the tar archive are modified by replacing realdir with savedir, so that the files will be extracted into savedir.

Return values

On successful completion, these functions will return 0. On failure, they will return -1 and set errno to an appropriate value.

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.

Releases

12 releases since Debian 3.0 (Woody); the text changed 1 time.

  1. 3.0–6.0
  2. 7–Arch

From libtar 1.2.20-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.