diff --git a/libarchive/entry.py b/libarchive/entry.py index 863dbc7..73f0909 100644 --- a/libarchive/entry.py +++ b/libarchive/entry.py @@ -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) diff --git a/libarchive/read.py b/libarchive/read.py index 3451376..d9c00ea 100644 --- a/libarchive/read.py +++ b/libarchive/read.py @@ -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) diff --git a/libarchive/write.py b/libarchive/write.py index 782e0f7..59a7565 100644 --- a/libarchive/write.py +++ b/libarchive/write.py @@ -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. """