Comments (6)
@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.
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.
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.
@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.
@Changaco any idea on this?
from python-libarchive-c.
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)
- Extract to specific folder HOT 2
- Minor test issues under pypy
- Attempting to use ArchiveEntry outside of for loop doesn't work
- read_next_header2() takes long time for closing archive in solid 7z archive when last file is big HOT 1
- Type checking
- Obtaining the position (byte offset) of an entry within the archive HOT 1
- `AttributeError` when using a libarchive version which doesn't support passphrases
- Cannot set uid/gid when adding file from memory
- hold strong reference of callback HOT 1
- Suggestion: Test file HOT 1
- Autodetection of libarchive version installed by Brew
- Tests with unicode path entires are failing HOT 2
- Ability to decrypt zip and 7z files HOT 3
- Extract empty files? HOT 2
- SECURE_NODOTDOT not having effect? HOT 1
- Writing 7zip file HOT 1
- Modifying the path of an entry before adding it to an archive HOT 1
- Detect valid archives HOT 3
- Inconsistent behavior for encrypted rar/zip/7z HOT 1
- Installing python-libarchive using pip via wheel HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-libarchive-c.