Create archiving program

This is a discussion on Create archiving program within the C Programming forums, part of the General Programming Boards category; Hi, all I'm trying to better my understanding of C by creating small programs, I've created quite a few recently ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    1

    Create archiving program

    Hi, all I'm trying to better my understanding of C by creating small programs, I've created quite a few recently and now my objective is to create an archiving program in C. Then I would like to extract the files in the archive from the command line into a given directory. Help would be much appreciated!

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Welcome to the forum, Dolby779!

    We don't do much of what you've asked for, however. The way the forum works is, you get the program started, and if/when you hit a snag in C, you post up the problem, including the code, a good description of the problem or error message, or an example of the problem. Then we jump in and help out at that time.

    If you want to post up an algorithm problem, then post the pseudo code for it, and give a good description of the problem. That's OK, also.

    So the start of your algorithm or your program, is up to you. I will mention that some archive utilities have command lines, and that would be a good first overview for you to learn about. 7z, PKZip, and RAR come to mind. AFAIK they all will use the archive bit to see whether a file has been changed or is new, and needs to be archived or not.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    114
    Hello! Are you trying to create a program that does file compression? If so, it might be important for you to look for compression algorithms.

    Regards

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    Cross-posted
    Much needed help - Dev Shed

    Really simple archiver:
    cat foo.txt bar.txt > archive.txt

    Now you start to figure out:
    - how to store the filename
    - how to store the size
    so that the unarchive operation has some idea what to do.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File archiving
    By Tony.h in forum C Programming
    Replies: 4
    Last Post: 01-10-2011, 05:07 PM
  2. Archiving help
    By smoothjammy1 in forum C Programming
    Replies: 4
    Last Post: 01-06-2011, 04:29 PM
  3. Testers wanted - archiving tool.
    By cboard_member in forum Game Programming
    Replies: 25
    Last Post: 08-31-2006, 06:12 AM
  4. Looking for some archiving utility
    By lobo in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-29-2003, 03:28 AM
  5. Archiving My Copies Of Linux
    By Troll_King in forum Linux Programming
    Replies: 11
    Last Post: 08-22-2002, 10:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21