Discussion in 'OT Technology' started by teamelement3, May 12, 2005.
Anyone know how to write a tar program, or know of a tutorial? I'm in dire need of help.
you want to rewrite the unix tar program?
linux's GNU version is open source, why don't you go download the code?
Exactly... tar is gnu. So just get the source for GNU tar. Its the same across all GNU based systems.
I can't think of why you would want to do this, though... its not hard to call tar from your program.
Have to do it for a C class I'm taking...
Get the GNU tar implementation, read it, and then make your own.
Otherwise, lookup the tar format. If I recall, its pretty simple. Mostly just concatenated files as binary data, one after the other. Probably with a marker in between, etc.
I downloaded it, and it's an assload of files. I only need one C file??
Tear through the .h's and figure out what is essential.
yea, tar offers no compression if I remember right. Probably just binary files concatenated together (like Peyomp said) with markers stored in a header. Shouldn't be too hard.
Yep. tar was originally written for writing data to tape drives...hence the name "tar -- tape archiver." Any compression to the data was assumed to be done by the device at write time.
It should be fairly trivial to re-write tar...seems like a stupid project for a class though.