Solved

Archiving System On Unix Using C language

Posted on 2000-04-08
1
203 Views
Last Modified: 2010-04-21
Does anybody know how to create or programme a simple script on UNIX about archiving files using C language. I have this difficulty archiving my files since I am used to WinZip in Windows systems. Somebody please help me !!!
0
Comment
Question by:icekube
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 2696395
Why re-invent the wheel? Any Unix has tar and compress and you can use them to archive directories and compress the archive to save space. For instance if I had a directory named the-code and I wanted to create a compressed tar archive of it I'd do:

tar cvf the-code.tar the-code | compress

The result would be a file named "the-code.tar.Z" in the current directory. When I wanted to unpack that archive I could use:

zcat the-code.tar.Z | tar xvf -

There are other compression tools (gzip, bzip2, etc) that are furnished with some Unix distributions or they can be downloaded and installed. Also some Unix distributions use Gnu tar (or similar) which can "compress/decompress on-the-fly" using commands like:

tar cvzf the-code.tar.gz the-code
tar xvzf the-code.tar.gz

There is also a PD version of a WinZIP compatible tool available (zip/unzip), Solaris 7 & later include the unzip portion.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now