Exemple #1
0
def _archive_read_disk_open(archive, filepath):
    try:
        return libarchive.calls.archive_read.c_archive_read_disk_open(
            archive, filepath)
    except:
        message = get_error_string(archive)
        raise libarchive.exception.ArchiveError(message)
Exemple #2
0
def _archive_read_set_format(archive, code):
    try:
        return libarchive.calls.archive_read.c_archive_read_set_format(
            archive, code)
    except:
        message = get_error_string(archive)
        raise libarchive.exception.ArchiveError(message)
Exemple #3
0
def _archive_read_disk_set_standard_lookup(archive):
    try:
        return libarchive.calls.archive_read.\
                c_archive_read_disk_set_standard_lookup(archive)
    except:
        message = get_error_string(archive)
        raise libarchive.exception.ArchiveError(message)
Exemple #4
0
def _archive_read_next_header2(archive, entry):
    r = libarchive.calls.archive_read.c_archive_read_next_header2(
        archive, entry)

    if r not in (libarchive.constants.archive.ARCHIVE_OK,
                 libarchive.constants.archive.ARCHIVE_EOF):
        message = get_error_string(archive)
        raise ValueError("Archive iteration (read_next_header2) returned "
                         "error: (%d) [%s]" % (r, message))

    return r
Exemple #5
0
def _archive_read_data_skip(archive):
    try:
        return libarchive.calls.archive_read.c_archive_read_data_skip(archive)
    except:
        message = get_error_string(archive)
        raise libarchive.exception.ArchiveError(message)