Solved

Archiving System On Unix Using C language

Posted on 2000-04-08
1
204 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

863 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

25 Experts available now in Live!

Get 1:1 Help Now