Solved

Archiving System On Unix Using C language

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…

691 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