Skip to content

Commit

Permalink
add support for reading rdevmajor and rdevminor
Browse files Browse the repository at this point in the history
  • Loading branch information
lunar-debian authored and Changaco committed Jul 31, 2015
1 parent a7220dd commit a5e968c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions libarchive/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,11 @@ def strmode(self):
# note we strip the mode because archive_entry_strmode
# returns a trailing space: strcpy(bp, "?rwxrwxrwx ");
return ffi.entry_strmode(self._entry_p).strip()

@property
def rdevmajor(self):
return ffi.entry_rdevmajor(self._entry_p)

@property
def rdevminor(self):
return ffi.entry_rdevminor(self._entry_p)
4 changes: 3 additions & 1 deletion libarchive/ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import division, print_function, unicode_literals

from ctypes import (
c_char_p, c_int, c_longlong, c_size_t, c_ssize_t, c_void_p, c_wchar_p,
c_char_p, c_int, c_uint, c_longlong, c_size_t, c_ssize_t, c_void_p, c_wchar_p,
CFUNCTYPE, POINTER,
)
import ctypes
Expand Down Expand Up @@ -119,6 +119,8 @@ def ffi(name, argtypes, restype, errcheck=None):
ffi('entry_hardlink_w', [c_archive_entry_p], c_wchar_p)
ffi('entry_symlink', [c_archive_entry_p], c_char_p)
ffi('entry_symlink_w', [c_archive_entry_p], c_wchar_p)
ffi('entry_rdevmajor', [c_archive_entry_p], c_uint)
ffi('entry_rdevminor', [c_archive_entry_p], c_uint)

ffi('entry_update_pathname_utf8', [c_archive_entry_p, c_char_p], None)

Expand Down

0 comments on commit a5e968c

Please sign in to comment.