Module: Archive

Defined in:
lib/ffi_libarchive/api.rb,
lib/ffi_libarchive/entry.rb,
lib/ffi_libarchive/utils.rb,
lib/ffi_libarchive/reader.rb,
lib/ffi_libarchive/writer.rb,
lib/ffi_libarchive/archive.rb

Defined Under Namespace

Modules: C, Utils Classes: BaseArchive, Entry, Error, Reader, Writer

Constant Summary collapse

FILTER_NONE =

Stream filter Codes

0
FILTER_GZIP =
1
FILTER_BZIP2 =
2
FILTER_COMPRESS =
3
FILTER_PROGRAM =
4
FILTER_LZMA =
5
FILTER_XZ =
6
FILTER_UU =
7
FILTER_RPM =
8
FILTER_LZIP =
9
FILTER_LRZIP =
10
FILTER_LZOP =
11
FILTER_GRZIP =
12
FILTER_LZ4 =
13
FILTER_ZSTD =
14
COMPRESSION_NONE =

region Compression Codes (deprecated)

FILTER_NONE
COMPRESSION_GZIP =
FILTER_GZIP
COMPRESSION_BZIP2 =
FILTER_BZIP2
COMPRESSION_COMPRESS =
FILTER_COMPRESS
COMPRESSION_PROGRAM =
FILTER_PROGRAM
COMPRESSION_LZMA =
FILTER_LZMA
COMPRESSION_XZ =
FILTER_XZ
COMPRESSION_UU =
FILTER_UU
COMPRESSION_RPM =
FILTER_RPM
COMPRESSION_LZIP =
FILTER_LZIP
COMPRESSION_LRZIP =
FILTER_LRZIP
FORMAT_BASE_MASK =

region Format Codes

0xff0000
FORMAT_CPIO =
0x10000
FORMAT_CPIO_POSIX =
(FORMAT_CPIO | 1)
FORMAT_CPIO_BIN_LE =
(FORMAT_CPIO | 2)
FORMAT_CPIO_BIN_BE =
(FORMAT_CPIO | 3)
FORMAT_CPIO_SVR4_NOCRC =
(FORMAT_CPIO | 4)
FORMAT_CPIO_SVR4_CRC =
(FORMAT_CPIO | 5)
FORMAT_CPIO_AFIO_LARGE =
(FORMAT_CPIO | 6)
FORMAT_SHAR =
0x20000
FORMAT_SHAR_BASE =
(FORMAT_SHAR | 1)
FORMAT_SHAR_DUMP =
(FORMAT_SHAR | 2)
FORMAT_TAR =
0x30000
FORMAT_TAR_USTAR =
(FORMAT_TAR | 1)
FORMAT_TAR_PAX_INTERCHANGE =
(FORMAT_TAR | 2)
FORMAT_TAR_PAX_RESTRICTED =
(FORMAT_TAR | 3)
FORMAT_TAR_GNUTAR =
(FORMAT_TAR | 4)
FORMAT_ISO9660 =
0x40000
FORMAT_ISO9660_ROCKRIDGE =
(FORMAT_ISO9660 | 1)
FORMAT_ZIP =
0x50000
FORMAT_EMPTY =
0x60000
FORMAT_AR =
0x70000
FORMAT_AR_GNU =
(FORMAT_AR | 1)
FORMAT_AR_BSD =
(FORMAT_AR | 2)
FORMAT_MTREE =
0x80000
FORMAT_RAW =
0x90000
FORMAT_XAR =
0xA0000
FORMAT_LHA =
0xB0000
FORMAT_CAB =
0xC0000
FORMAT_RAR =
0xD0000
FORMAT_7ZIP =
0xE0000
FORMAT_WARC =
0xF0000
FORMAT_RAR_V5 =
0x100000
EXTRACT_OWNER =

region Extraction Flags

0x0001
EXTRACT_PERM =
0x0002
EXTRACT_TIME =
0x0004
EXTRACT_NO_OVERWRITE =
0x0008
0x0010
EXTRACT_ACL =
0x0020
EXTRACT_FFLAGS =
0x0040
EXTRACT_XATTR =
0x0080
0x0100
EXTRACT_SECURE_NODOTDOT =
0x0200
EXTRACT_NO_AUTODIR =
0x0400
EXTRACT_NO_OVERWRITE_NEWER =
0x0800
EXTRACT_SPARSE =
0x1000
EXTRACT_MAC_METADATA =
0x2000
EXTRACT_NO_HFS_COMPRESSION =
0x4000
EXTRACT_HFS_COMPRESSION_FORCED =
0x8000
EXTRACT_SECURE_NOABSOLUTEPATHS =
0x10000
EXTRACT_CLEAR_NOCHANGE_FFLAGS =
0x20000

Class Method Summary collapse

Class Method Details

.read_open_filename(file_name, command = nil) {|| ... } ⇒ Reader

Parameters:

  • file_name (String)

Yield Parameters:

Returns:



96
97
98
# File 'lib/ffi_libarchive/archive.rb', line 96

def read_open_filename(file_name, command = nil, &block)
  Reader.open_filename file_name, command, &block
end

.read_open_memory(string, command = nil) {|| ... } ⇒ Reader

Parameters:

  • string (String)

Yield Parameters:

Returns:



103
104
105
# File 'lib/ffi_libarchive/archive.rb', line 103

def read_open_memory(string, command = nil, &block)
  Reader.open_memory string, command, &block
end

.read_open_stream(reader, command = nil) {|| ... } ⇒ Reader

Parameters:

  • reader (#call)

Yield Parameters:

Returns:



110
111
112
# File 'lib/ffi_libarchive/archive.rb', line 110

def read_open_stream(reader, command = nil, &block)
  Reader.open_stream reader, command, &block
end

.version_numberInteger

Returns:

  • (Integer)


129
130
131
# File 'lib/ffi_libarchive/archive.rb', line 129

def version_number
  C.archive_version_number
end

.version_stringString

Returns:

  • (String)


134
135
136
# File 'lib/ffi_libarchive/archive.rb', line 134

def version_string
  C.archive_version_string
end

.write_open_filename(file_name, compression, format) {|| ... } ⇒ Writer

Parameters:

  • file_name (String)

Yield Parameters:

Returns:



117
118
119
# File 'lib/ffi_libarchive/archive.rb', line 117

def write_open_filename(file_name, compression, format, &block)
  Writer.open_filename file_name, compression, format, &block
end

.write_open_memory(string, compression, format) {|| ... } ⇒ Writer

Parameters:

  • string (String)

Yield Parameters:

Returns:



124
125
126
# File 'lib/ffi_libarchive/archive.rb', line 124

def write_open_memory(string, compression, format, &block)
  Writer.open_memory string, compression, format, &block
end