---
name: "archive_write_new"
section: "3"
platform: "macos"
package: "libarchive"
version: "167.120.3"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/archive_write_new"
---

# archive\_write\_new(3)

functions for creating archives

## NAME

**archive\_write\_new** - functions for creating archives

## LIBRARY

Streaming Archive Library (libarchive, -larchive)

## SYNOPSIS

**#include \<archive.h\>**\
 *struct archive \**\
 **archive\_write\_new**(*void*);

## DESCRIPTION

Allocates and initializes a Tn struct archive object suitable for writing a tar archive. **NULL** is returned on error.

A complete description of the Tn struct archive object can be found in the overview manual page for [**libarchive**(3)](/libarchive/3.md).

## SEE ALSO

[**tar**(1)](/tar/1.md), [**archive\_write**(3)](/archive_write/3.md), [**archive\_write\_set\_options**(3)](/archive_write_set_options/3.md), [**libarchive**(3)](/libarchive/3.md), [**cpio**(5)](/cpio/5.md), [**mtree**(5)](/mtree/5.md), [**tar**(5)](/tar/5.md)
