Giter VIP home page Giter VIP logo

tar's People

Contributors

25077667 avatar calccrypto avatar fonkamloic avatar lozack19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tar's Issues

Compression size

Hi, Your code suppose to compress the files? Or maybe I am missing something...

No error is shown when removing nonexistent file from archive

Hello,
When I remove a nonexistent file from an archive, I get Exiting with error due to previous error but no other errors are shown:

$ touch test1 test2 test3
$ tar -cf test.tar test1 test2 test3
$ exec r test.tar test4
Exiting with error due to previous error

Development of this library

Are there any plans to expand on this library, for example, to add support for gzip / xz decompression.
Many people (including myself), find libarchive more complicated than it needs to be. I believe that if this library was expanded upon, it could be a suitable alternative.
Regards.

undefined minor/major

From man major:

[…] was deprecated in glibc 2.25, and since glibc 2.28, <sys/types.h> no longer provides these definitions.

Issue with Makefile

Whenever I try to test this out I get a permission-denied error with mknod. This is the output of running "make test":

cc -Wall -std=c99 -c tar.c
ar -r libtar.a tar.o
ar: creating libtar.a
cc -Wall -std=c99 main.c -o exec -ltar -L.
rm -rf test.tar char block sym pipe folder file real out
create fake directory entries
mknod: block: Operation not permitted
make: *** [Makefile:27: test] Error 1

What is going wrong here?

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.

Does not compile with c11 standards.

One may compile if the -std=c11 flag is removed from the Makefile.

tar.c:551:26: error: ‘S_IFMT’ undeclared (first use in this function)
     switch (st.st_mode & S_IFMT) {

Also applies with {S_IFREG, S_IFLINK, S_IFCHR, S_IFBLK, S_IFDIR, S_IFIFO, S_IFSOCK}

Help information is never displayed

The block in main.c that displays help information is never executed:

if (argc == 2){
    fprintf(stdout, "Usage: %s options(s) tarfile [sources]\n"\
    ...
}

because its condition is always satisfied by the preceding if block, which terminates the program.

CHAR and BLOCK entries are never handled in extract_entry()

Hello,

I've spotted two issues within extract_entry() function.

A. This conditional branch:

if ((entry -> type == CHAR) || (entry -> type == BLOCK))

is never reached as it inside another condition:

if ((entry -> type == REGULAR) || (entry -> type == NORMAL) || (entry -> type == CONTIGUOUS))

I guess the first if () should be moved out of the second one.

B. This condition looks redundant:

if ((entry -> type == REGULAR) || (entry -> type == NORMAL) || (entry -> type == CONTIGUOUS))

as it's already inside the same condition.

crash on tar_read() in tar.c

44: for(count = 0; ; count++){
45: *tar = malloc(sizeof(struct tar_t));

On line 45 memory is reserved which leads to problems, because the 'next' pointer of the structure doesn't point to NULL. The program crashes on tar_free().

I changed the line to *tar = calloc(1, sizeof(struct tar_t)); to fix this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.