Skip to content

Commit fba9f93

Browse files
committed
add constants for file types
1 parent 39af669 commit fba9f93

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

libarchive/entry.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
from contextlib import contextmanager
22
from ctypes import c_char_p, create_string_buffer
3+
from enum import IntEnum
34
import math
45

56
from . import ffi
67

78

9+
class FileType(IntEnum):
10+
NAMED_PIPE = AE_IFIFO = 0o010000 # noqa: E221
11+
CHAR_DEVICE = AE_IFCHR = 0o020000 # noqa: E221
12+
DIRECTORY = AE_IFDIR = 0o040000 # noqa: E221
13+
BLOCK_DEVICE = AE_IFBLK = 0o060000 # noqa: E221
14+
REGULAR_FILE = AE_IFREG = 0o100000 # noqa: E221
15+
SYMBOLINK_LINK = AE_IFLNK = 0o120000 # noqa: E221
16+
SOCKET = AE_IFSOCK = 0o140000 # noqa: E221
17+
18+
819
@contextmanager
920
def new_archive_entry():
1021
entry_p = ffi.entry_new()

0 commit comments

Comments
 (0)