---
name: "tar_extract_all"
section: "3"
platform: "linux"
package: "libtar"
version: "1.2.20-8"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/tar_extract_all"
---

# tar\_extract\_all(3)

high-level tar archive manipulation functions

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

## DESCRIPTION

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.

## SEE ALSO

**opendir**(2), [**lstat**(2)](/lstat/2.md), [**tar\_skip\_regfile**(3)](/tar_skip_regfile/3.md), [**tar\_extract\_regfile**(3)](/tar_extract_regfile/3.md), [**tar\_append\_file**(3)](/tar_append_file/3.md)
