Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tar_append_eof(3) [centos man page]

tar_append_file(3)						  C Library Calls						tar_append_file(3)

NAME
tar_append_file, tar_append_eof, tar_append_regfile - append data to tar archives SYNOPSIS
#include <libtar.h> int tar_append_file(TAR *t, char *realname, char *savename); int tar_append_regfile(TAR *t, char *realname); int tar_append_eof(TAR *t); VERSION
This man page documents version 1.2 of libtar. DESCRIPTION
The tar_append_file() function creates a tar file header block describing the file named by the realname argument, but with the encoded filename of savename. It then sets the current header associated with the TAR handle t to the newly created header block, and writes this block to the tar archive associated with t. If the file named by realname is a regular file (and is not encoded as a hard link), tar_append_file() will call tar_append_regfile() to append the contents of the file. The tar_append_regfile() function appends the contents of a regular file to the tar archive associated with t. Since this function is called by tar_append_file(), it should only be necessary for applications that construct and write the tar file header on their own. The tar_append_eof() function writes an EOF marker (two blocks of all zeros) to the tar file associated with t. RETURN VALUES
On successful completion, these functions will return 0. On failure, they will return -1 and set errno to an appropriate value. ERRORS
The tar_append_*() functions will fail if: EINVAL Less than T_BLOCKSIZE bytes were written to the tar archive. EINVAL Less than T_BLOCKSIZE bytes were read from the realname file. They may also fail if any of the following functions fail: lstat(), malloc(), open(), read(), th_write(), or the write function for the file type associated with the TAR handle t. SEE ALSO
read(2), open(2), lstat(2), th_write(3) University of Illinois Jan 2001 tar_append_file(3)

Check Out this Related Man Page

tar_extract_file(3)						  C Library Calls					       tar_extract_file(3)

NAME
tar_extract_file, tar_extract_regfile, tar_extract_hardlink, tar_extract_symlink, tar_extract_chardev, tar_extract_blockdev, tar_extract_dir, tar_extract_fifo, tar_skip_regfile, tar_set_file_perms - extract files from a tar archive SYNOPSIS
#include <libtar.h> int tar_extract_file(TAR *t, char *realname); int tar_extract_regfile(TAR *t, char *realname); int tar_skip_regfile(TAR *t); int tar_extract_dir(TAR *t, char *realname); int tar_extract_hardlink(TAR *t, char *realname); int tar_extract_symlink(TAR *t, char *realname); int tar_extract_blockdev(TAR *t, char *realname); int tar_extract_chardev(TAR *t, char *realname); int tar_extract_fifo(TAR *t, char *realname); int tar_set_file_perms(TAR *t, char *realname); VERSION
This man page documents version 1.2 of libtar. DESCRIPTION
The tar_extract_file() function acts as a front-end to the other tar_extract_*() functions. It checks the current tar header associated with the TAR handle t (which must be initialized first by calling th_read()) to determine what kind of file the header refers to. It then calls the appropriate tar_extract_*() function to extract that kind of file. The tar_skip_regfile() function skips over the file content blocks and positions the file pointer at the expected location of the next tar header block. The tar_set_file_perms() function sets the attributes of the extracted file to match the encoded values. This includes the file's modifi- cation time, mode, owner, and group. This function is automatically called by tar_extract_file(), but applications which call the other tar_extract_*() functions directly will need to call tar_set_file_perms() manually if this behavior is desired. RETURN VALUES
On successful completion, the functions documented here will return 0. On failure, they will return -1 and set errno to an appropriate value. The tar_extract_dir() function will return 1 if the directory already exists. ERRORS
The tar_extract_file() function will fail if: EEXIST If the O_NOOVERWRITE flag is set and the file already exists. The tar_extract_*() functions will fail if: EINVAL An entry could not be added to the internal file hash. EINVAL Less than T_BLOCKSIZE bytes were read from the tar archive. EINVAL The current file header associated with t refers to a kind of file other than the one which the called function knows about. They may also fail if any of the following functions fail: mkdir(), write(), link(), symlink(), mknod(), mkfifo(), utime(), chown(), lchown(), chmod(), or lstat(). SEE ALSO
mkdir(2), write(2), link(2), symlink(2), mknod(2), mkfifo(2), utime(2), chown(2), lchown(2), chmod(2), lstat(2) University of Illinois Jan 2001 tar_extract_file(3)
Man Page