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!
Welcome to the forum, Dolby779! :cool:
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.
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.
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.