Giter Club home page Giter Club logo

Comments (6)

pombreda avatar pombreda commented on June 11, 2024

@Changaco I cannot understand what this code does, why and how. Sorry for my crass ignorance, but I need your help.
https://github.com/Changaco/python-libarchive-c/blob/master/libarchive/write.py#L56

here: https://github.com/Changaco/python-libarchive-c/blob/master/libarchive/write.py#L61
Why are you trying to read the files to add to the archive as if they were archives themselves?

from python-libarchive-c.

Changaco avatar Changaco commented on June 11, 2024

Why are you trying to read the files to add to the archive as if they were archives themselves?

Because that's the correct way to do it. libarchive handles walking the file system and filling the entry struct, the python code reads the actual content of the files and ties everything together.

from python-libarchive-c.

pombreda avatar pombreda commented on June 11, 2024

FWIW, I do not care for writing archives since I use libarchive only to extract things, but I am still not sure why you would use a combo of opening and reading the file in Python and using the directory traversal of libarchive. If read things correctly, libarchive can do both traversal and file reading?

from python-libarchive-c.

pombreda avatar pombreda commented on June 11, 2024

@Changaco I still think that there is something that is likely not to work at all on posix for special files here: https://github.com/Changaco/python-libarchive-c/blob/master/libarchive/write.py#L68
Opening a FIFO or character/device file like this usually has funny consequences such has a hanging.
libarchive knows how to handle these alright afaik, so reading in python is likely not covering all the cases. Doing a test with a temp os.mkfifo is likely to break IMHO

from python-libarchive-c.

pombredanne avatar pombredanne commented on June 11, 2024

@Changaco any idea on this?

from python-libarchive-c.

Changaco avatar Changaco commented on June 11, 2024

Looks like I forgot to answer here.

If read things correctly, libarchive can do both traversal and file reading?

Does it? I don't remember seeing a function to do the actual file reading in libarchive.

from python-libarchive-c.

Related Issues (20)

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.