Categories
PHP
Javascript
MySQL
C#
VB
VB.NET
ASP.NET
Regex
Packaging & compression
General Web Tech
Tech Speak


Google


This website looks best on firefox.
 
Resource Center : Packaging & compression : <Using Tar to package, or archive / compress files>

Using Tar to package, or archive / compress files

Posted by: Floresense Team
Pages: 1  2  

Tar


Tar was initially developed for the unix platform. It is a program that gives the ability to package many files and folders into a single file. It was used to backup or store files conveniently on magnetic tapes, and hence it became tape-archives or tar.

An archive is a single file which contains the contents of many files, while still identifying the names of the files, their owner(s), permissions, and so forth.

tar is widely used to package a number of files and directories into a single file creating .tar, .tar.gz, .tar.tgz archive files/ compressed files that are cross-platform. Yes, even windows support them indirectly.. popular 3rd party compression softwares for windows like Winzip support extraction of these compressed files.

You can download the tar program from the below location. tar program versions for windows, unix, linux, etc, are provided.
http://www.gnu.org/software/tar/

When you tar a set of files or folders, their contents are organized into a single file with possibly a bigger size than the original size of the files or folders put together. The increased size would accomodate information regarding the structure of the package, so that it can disassembled into file or folder units.

tar packaging example:

D:\>tar --create --file=d:\temp\practise\collection.tar d:\temp\practise\blues.txt
Creates the target archive file and puts blues.txt file into it.

D:\>tar --append --file=d:\temp\practise\collection.tar d:\temp\practise\jazz.txt
Adds a new file jazz.txt to archive already created.

Finally, we have an archive collections.tar with files blues.txt, jazz.txt

To package folders using tar:

d:\>tar --create --file=d:\temp\collection.tar D:\harish\WeekInPhotos\photos
Creates an archive of the folder photos with all its contents.

tar was developed for the sole purpose of packaging.. and not for compression like many think... though it is used for compression these days. tar was built by many developers improving on the work of previous authors and is even today consistently being improved to fit new features as may be found neccessary. And hence, the later versions of tar started supporting file compression.

tar, as of today, supports two compression programs gzip and bzip2.

Next page has:
How to create compressed archives, and,
Related links to gzip and bzip2 web locations.
Pages: 1  2  

Advertisement

2005 - 2008 © Floresense.com