Solved

Archiving System On Unix Using C language

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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 …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

805 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