Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libarchive/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ def modify(self, header_codec=None, **attributes):
for name, value in attributes.items():
setattr(self, name, value)

@property
def pointer(self):
"""Returns the FFI pointer to the `archive_entry` struct"""
return self._entry_p

@property
def filetype(self):
return ffi.entry_filetype(self._entry_p)
Expand Down
5 changes: 5 additions & 0 deletions libarchive/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def __iter__(self):
yield entry
entry.__class__ = PassedArchiveEntry

@property
def pointer(self):
"""Returns the FFI pointer to the `archive_read` struct"""
return self._pointer

@property
def bytes_read(self):
return ffi.filter_bytes(self._pointer, -1)
Expand Down
5 changes: 5 additions & 0 deletions libarchive/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def __init__(self, archive_p, header_codec='utf-8'):
self._pointer = archive_p
self.header_codec = header_codec

@property
def pointer(self):
"""Returns the FFI pointer to the `archive_write` struct"""
return self._pointer

def add_entries(self, entries):
"""Add the given entries to the archive.
"""
Expand Down