Not enough documentation
I like this library, but I would love to read more documentation. In order to be able to use it I needed to read the source code, which could be avoided if there was a good documentation about how to use the function together with some little and explanatory examples.
Yes, currently, I'm trying to figure out how to extract all the files from a tarball, but this library lacks explanations (such as a man page)
Hi. The code in this repository was written because I wanted to practice C. I am no longer actively working on it. If you wish to push documentation commits, I will accept them.
If you look at the bottom of main.c, there are examples calls to the various functions.
Yes, currently, I'm trying to figure out how to extract all the files from a tarball, but this library lacks explanations (such as a man page)
int ex_tar(char * tar_file)
{
char * g[2] = {0};
int fd;
struct tar_t * archive = NULL;
int ret;
char verbosity = 0; // 0: no print; 1: print file names; 2: print file properties
g[0] = tar_file;
g[1] = NULL;
fd = open(tar_file, O_RDONLY);
if (fd == -1)
{
return -1;
}
// read in data
if (tar_read(fd, &archive, verbosity) < 0){
tar_free(archive);
close(fd);
return -1;
}
ret = tar_extract(fd, archive, 0, (const char**)g, verbosity);
if (ret < 0)
{
close(fd);
ret = -1;
}
close(fd);
return 0;
}