Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading Archive from bytes in memory #40

Open
rpm5099 opened this issue May 23, 2024 · 0 comments
Open

Reading Archive from bytes in memory #40

rpm5099 opened this issue May 23, 2024 · 0 comments

Comments

@rpm5099
Copy link

rpm5099 commented May 23, 2024

I would like to be able to read archives from memory, however the Archive class doesn't allow that. If you try to pass it using BytesIO it fails because it has a non-functional fileno property (there's no actual file descriptor open). libarchive has a function that seems to support this in archive_read_open_memory(arg1, buff, size) but I cannot seem to convert a python bytes object to the correct type required by that function using ctypes. Everything I've tried ends up with the error:

TypeError: in method 'archive_read_open_memory', argument 2 of type 'void const *'

Could you show the correct way to pass python bytes to that function argument buff? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant