tar_extract_all(3) C Library Calls tar_extract_all(3)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), tar_skip_regfile(3), tar_extract_regfile(3), tar_append_file(3)University of Illinois Jan 2001 tar_extract_all(3)
Check Out this Related 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)
Hi folks,
When I am extracting an archive using the:
tar -xvf /dev/rmt0 command i get the following error:
x ./GRBD8901/GRBR006T, 1763253368 bytes, 3443855 media blocks.
tar: 0511-197 ./GRBD8901/GRBR006T: Cannot write data extracted with the tar command: ... (7 Replies)
I'm trying to tar 3000 files into a single tar file to be extracted on another server. Command I'm using:
find . -name '*cost*' -print| xargs tar -cvf mylist.tar (Note tar is contained on filesystem not tape drive which is what I want)
Above command works fine and displays all 3000+ file... (3 Replies)
I want to insert file to tar file (by tar command).
The file is currently in a diffrenet directory and i want to be saved
at the tar file as it was in other directory.
I write the script in korn shell. How can i do it? (0 Replies)
Is it possible to update a file in a compressed archive.tgz using the tar app without uncompressing/extracting, update and compressing/creating ?
tar -uvzf archive.tgz ./file.txt
tar: Cannot update compressed archives
Try `tar --help' for more information. (1 Reply)
Hi,
Can anyone tell me the right TAR command to restore
all the files dirs/subdirs/files etc. to a given directory on my hdd from a TAPE drive?
I already used the list function to see that there is data on it with this commando:
# tar tf /dev/st0
Now I need to copy all the data to a... (1 Reply)
Hello all,
I was attempting to create a tar file via this command:
tar cpf 20100529.tar | find . -name *20100529*
Attempt to create archive of no files. Nothing dumped.
which produced a list of several files in the .tar file but in the end the file was:
-rw-r--r-- 1 xxx_xxxx users ... (9 Replies)
How you do usually deal with files in use during a backup?
Is there a option to let TAR skip opened files?
Or notify me an opened file is tar'ed?
What's the best practice?
Thanks (3 Replies)
Hi,
Another rookie here.
I have a script I am developing to backup files from various directories onto a windows machine.
Script description:
- mv files from various directories
- tar all files in that directory
- export to windows server for safe keeping, external backups.
The... (5 Replies)
Hello. I`m writing a bash script who archive log files and send them to backup server. I need some kind of checking mechanism for *.tar.gz files.
I found something like: gunzip -t file.tar.gz //Not output from it.
And for tar: tar tf file.tar.gz //Only lists archive
1.) I need make a... (3 Replies)
Need to
1. archive all the files in a directory from the previous month into a tar/gz file, ignoring all already archived 'tar.gz' files
2. Check created .tar.gz file isnt corrupted and has all the required files in it. and then remove the original files.
I am using a function to get the... (1 Reply)