Solved

Archiving System On Unix Using C language

Posted on 2000-04-08
1
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

733 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