03-03-2012
Have a read through the tar man page for starters
Man Page for tar (Linux Section 1) - The UNIX and Linux Forums
Tar is one of the most difficult commands to master (IMHO) as it's command line syntax is very "old school". There are a fair few options to deal with, but to create a simple tar file of the current directory you only need to pay attention to the create "function letter," the file (archive) name option, and remember that dot (".") represents the current directory.
The examples in the man page, and these few hints should get you going.
If you have specific problems after you formulate your command, post those and someone will be happy to help.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory?
For example the archive files may have a filename of
/SrcFiles/XXX/filename.dat
and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was... (1 Reply)
Discussion started by: nmalencia
1 Replies
2. Solaris
Dear all
I am in a problem. I have created a master server on which I have install a Solaris 10 OS as well as Oracle 10g with some additional solaris packages. Now I want to create a flash archive of this server and install that flash archive on another server, so that the new server will have... (6 Replies)
Discussion started by: girish.batra
6 Replies
3. Shell Programming and Scripting
Hi
Why is creating an RCS archive in /etc a "good thing"?
Hi
Why is creating an RCS archive in /etc a "good thing"? (2 Replies)
Discussion started by: scofiled83
2 Replies
4. Shell Programming and Scripting
Hi All,
I would like to extract specific file from a zip archive.
I have a zip archive "sample.zip".
sample.zip contains few text files and images... text1.txt, text2.txt, pic.jpg etc...
I need to read specific file "text2.txt" from "sample.zip" WITHOUT EXTRACTING the zip file.
... (4 Replies)
Discussion started by: sridharg
4 Replies
5. Shell Programming and Scripting
Hi there,
I have one huge archive (it's a system image).
I need sometime to create smaller archives with only one or two file from my big archive.
So I'm looking for a command that extracts files from an archive and pipe them to another one.
I tried the following :
tar -xzOf oldarchive.tgz... (5 Replies)
Discussion started by: chebarbudo
5 Replies
6. Shell Programming and Scripting
I have some variables containing for example
m02-npt02-sr40-syn-dv0p01-16x12drw
m02-npt02-sr40-syn-dv0p02-16x12drw
m02-npt02-sr40-dv0p03-syn-16x12drw
I want to extract the dv entry for example
dv0p01
dv0p02
dv0p03
Then I want to convert to a numeric, the p specifies the... (5 Replies)
Discussion started by: kristinu
5 Replies
7. UNIX for Dummies Questions & Answers
Hi guys,
Why is creating an RCS archive in /etc a "good thing"?? (1 Reply)
Discussion started by: lemon_06
1 Replies
8. Shell Programming and Scripting
Help needed (1 Reply)
Discussion started by: Chand Shrestha
1 Replies
9. UNIX for Advanced & Expert Users
Is there a way to create a self extracting archive that works in both linux and windows? And if so how? Everything I have read on google only works in either Linux or Windows but not both. (6 Replies)
Discussion started by: cokedude
6 Replies
LEARN ABOUT DEBIAN
zip_source_function
ZIP_SOURCE_FUNCTION(3) Library Functions Manual ZIP_SOURCE_FUNCTION(3)
NAME
zip_source_function - create data source from function
LIBRARY
libzip (-lzip)
SYNOPSIS
#include <zip.h>
struct zip_source * zip_source_function(struct zip *archive, zip_source_callback fn, void *userdata);
DESCRIPTION
The function zip_source_function creates a zip source from the user-provided function fn, which must be of the following type: typedef
zip_int64_t (*zip_source_callback)(void *state,
void *data, zip_uint64_t len, enum zip_source_cmd cmd);
When called by the library, the first argument is the userdata argument supplied to zip_source_function. The next two arguments are a buf-
fer data of size len when data is expected to be returned, or else NULL and 0. The last argument, cmd, specifies which action the function
should perform:
ZIP_SOURCE_OPEN Prepare for reading. Return 0 on success, -1 on error.
ZIP_SOURCE_READ Read data into the buffer data of size len. Return the number of bytes placed into data on success, -1 on
error.
ZIP_SOURCE_CLOSE Reading is done. Return 0.
ZIP_SOURCE_STAT Get meta information for the input data. data points to an initialized which should be filled in. (See
zip_stat_init(3). ) Information only available after the source has been read (e.g. size) can be omitted in an
earlier call. Return sizeof(struct zip_stat) on success, -1 on error.
ZIP_SOURCE_ERROR Get error information. data points to an array of two ints, which should be filled with the libzip error code
and the corresponding system error code for the error that occurred. See zip_errors(3) for details on the
error codes. Return return(2 * sizeof(int)).
ZIP_SOURCE_FREE Clean up and free all resources. Return 0.
The library will always issue ZIP_SOURCE_OPEN before issuing ZIP_SOURCE_READ. When it no longer wishes to read from this source, it will
issue ZIP_SOURCE_CLOSE. If the library wishes to read the data again, it will issue ZIP_SOURCE_OPEN a second time. If the function is
unable to provide the data again, it should return -1.
ZIP_SOURCE_STAT can be issued at any time. ZIP_SOURCE_ERROR will only be issued in response to the function returning -1. ZIP_SOURCE_FREE
will be the last command issued; if ZIP_SOURCE_OPEN was called and succeeded, ZIP_SOURCE_CLOSE will be called before ZIP_SOURCE_FREE.
RETURN VALUES
Upon successful completion, the created source is returned. Otherwise, NULL is returned and the error code in archive is set to indicate
the error.
ERRORS
zip_source_function fails if:
[ZIP_ER_MEMORY]
Required memory could not be allocated.
SEE ALSO
libzip(3), zip_add(3), zip_replace(3), zip_source_buffer(3), zip_source_file(3), zip_source_filep(3), zip_source_free(3),
zip_source_zip(3), zip_stat_init(3)
AUTHORS
Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
NiH March 30, 2009 ZIP_SOURCE_FUNCTION(3)