package core:archive/sevenz
Overview
Reads, writes and updates 7z archives, as described by DOC/7zFormat.txt in Igor Pavlov's
public domain LZMA SDK.
open reads an archive from a path, a byte slice or a seekable io.Stream, also behind the stub
of a self-extracting executable (MZ, ELF or Mach-O) when the archive starts in its first
SFX_SEARCH_MAX bytes; update, remove_entry and rename_entry keep the stub. create starts
a new archive at a path or on a seekable io.Stream, write_entry adds a member from a byte
slice or an io.Reader, write_directory adds a whole tree, and commit finishes the
archive. update appends members to an existing archive in place, and write_anti_item marks
a path as deleted; at a path, remove_entry and rename_entry rewrite it, re-encoding a solid
folder that loses only some of its members. close releases a reader or a writer. A crash
during an update at a path leaves the last committed archive. At a path, readers take a shared
lock and writers an exclusive one, except on wasi.
Members are read through an iterator: iterator_create walks them in storage order, which
decodes each solid folder only once, iterate gives each one's archive.File_Info, and
extract_current unpacks it to an io.Writer, or open_current streams it through an
io.Reader. find looks a member up by path for extract or open_member, and
core:archive's extract_all unpacks a whole archive below a directory. Extraction checks each
member's CRC-32.
The methods are Copy, LZMA, LZMA2 (the writer's default), PPMd, Deflate, Deflate64 and bzip2,
and the filters Delta, BCJ (x86, PowerPC, IA-64, ARM, ARM Thumb, SPARC, ARM64 and RISC-V),
BCJ2, Swap2 and Swap4. The writer picks a filter from the data unless told otherwise, and can
pack members into solid folders, capped by size and member count and ordered by name or
extension. Encryption is 7-Zip's AES-256, which also covers the header unless
unencrypted_header is set; archive.Read_Options takes the password and caps the key
derivations per reader. Written headers are compressed unless plain_header is set.
Reading and writing take an optional progress callback, for a UI's progress bar, which can also cancel. A deterministic mode writes reproducible archives.
Not supported: writing new self-extracting archives, reading or writing multi-volume archives, and methods beyond those above, such as the Zstandard and LZ4 of 7-Zip's forks. On js, only byte slices and streams work.
Index
Variables (0)
This section is empty.
Procedures (32)
Procedure Groups (7)
Types
Entry ¶
Entry :: struct { path: string, // The name, converted from UTF-16 to UTF-8 raw_path: []u8, // The name's UTF-16LE bytes as stored, without the terminator size: i64, // The data's size once unpacked, in bytes crc: runtime.Maybe($T=u32), // The data's CRC-32, if stored folder: int, // The folder (block) holding the data, -1 without data folder_offset: i64, // Where the data starts in the folder's decoded output has_stream: bool, // `false` for a directory, an empty file or an anti-item is_directory: bool, // `true` for a directory is_anti: bool, // An anti-item: applied as an update, it deletes `path` attributes: runtime.Maybe($T=u32), // DOS attributes; with `UNIX_EXTENSION`, the Unix mode << 16 creation_time: runtime.Maybe($T=u64), // Windows FILETIME, as are the other times access_time: runtime.Maybe($T=u64), // The last access, if stored modification_time: runtime.Maybe($T=u64), // The last change, if stored start_position: runtime.Maybe($T=u64), }
A member's record in the archive header, from current_entry
Entry_Data ¶
A regular file's data, for write_entry
Related Procedures With Parameters
- write_entry_simple
- write_entry_with_info
- write_entry (procedure groups)
Entry_Options ¶
Entry_Options :: struct { method: archive.Method, // `.Unknown` for the writer's level: runtime.Maybe($T=int), // `nil`: the writer's for its method, else the default filter: Filter_Choice, // `.Auto` for the writer's filter and distance delta_distance: int, // 1 to 256, for `.Delta`; 0 means 1 lzma: runtime.Maybe($T=Options), // LZMA and LZMA2 settings in place of the level's ppmd: runtime.Maybe($T=Properties), // PPMd settings in place of the level's; variant H password: runtime.Maybe($T=string), // `nil` for the writer's, `""` for none replace: bool, }
One member's settings; all but replace stand in for the Writer_Options defaults
Related Procedures With Parameters
- write_directory
- write_entry_simple
- write_entry_with_info
- write_entry (procedure groups)
Error ¶
Error :: archive.Error
Related Procedures With Returns
- commit
- create_from_path
- create_from_stream
- extract_current_to_dynamic
- extract_current_to_writer
- extract_to_dynamic
- extract_to_writer
- find
- iterator_error
- open_current
- open_from_bytes
- open_from_path
- open_from_stream
- open_member
- read_link
- remove_entry
- rename_entry
- update_from_path
- update_from_stream
- write_anti_item
- write_directory
- write_entry_simple
- write_entry_with_info
- create (procedure groups)
- extract (procedure groups)
- extract_current (procedure groups)
- open (procedure groups)
- update (procedure groups)
- write_entry (procedure groups)
Filter_Choice ¶
Filter_Choice :: enum u8 { Auto, // Picked from the data; x86 code may get BCJ2. In `Entry_Options`: the writer's None, Delta, // Byte-wise delta, over `delta_distance` bytes BCJ_X86, BCJ_PPC, BCJ_IA64, BCJ_ARM, BCJ_ARMT, BCJ_SPARC, BCJ_ARM64, BCJ_RISCV, BCJ2, // x86 branch converter with four streams Swap2, // Swaps the bytes of each 16-bit word Swap4, // Reverses the bytes of each 32-bit word }
The filter a writer applies before compression
Reader ¶
Reader :: struct { allocator: runtime.Allocator, options: compress.Options, store: Store, base: i64, file: io.Stream, journal: []archive.Range, header: []u8, owns_header: bool, header_start: i64, streams: Streams, items: []Entry, names: []u8, index: []Name_Index, generation: u32, password: string, keys: Key_Cache, }
Reads a 7z archive, from open
Related Procedures With Parameters
- close_reader
- extract_to_dynamic
- extract_to_writer
- find
- info
- iterator_create
- open_from_bytes
- open_from_path
- open_from_stream
- open_member
- close (procedure groups)
- extract (procedure groups)
- open (procedure groups)
SevenZ_Error ¶
SevenZ_Error :: archive.SevenZ_Error
Solid_Order ¶
Solid_Order :: enum u8 { Name, // By path Extension, // By kind of extension, as 7-Zip does, then by path }
How write_directory orders the files in solid mode, after grouping them by filter
Writer ¶
Writer :: struct { allocator: runtime.Allocator, options: Writer_Options, stream: io.Stream, disk: archive.Disk, start: i64, offset: i64, end: i64, pack_sizes: [dynamic]i64, folders: [dynamic]Out_Folder, files: [dynamic]Out_File, names: [dynamic]u8, name: [dynamic]u8, header: [dynamic]u8, chunk: []u8, head: []u8, filter_buffer: []u8, cipher_buffer: []u8, folder: Open_Folder, password: string, kdf_power: int, salt: [16]u8, salted: bool, keys: Key_Cache, ciphers: [dynamic]Out_Cipher, archive_in: i64, err: archive.Error, committed: bool, active: bool, mode: Writer_Mode, pack_pos: i64, old: Reader, old_length: i64, data_start: i64, saved: []archive.Range, kept: [dynamic]int, slots: [dynamic]Update_Slot, heads: map[string]int, guard: bool, journaled: bool, modified: bool, must_rewrite: bool, repacking: bool, }
Related Procedures With Parameters
- close_writer
- commit
- create_from_path
- create_from_stream
- remove_entry
- rename_entry
- update_from_path
- update_from_stream
- write_anti_item
- write_directory
- write_entry_simple
- write_entry_with_info
- close (procedure groups)
- create (procedure groups)
- update (procedure groups)
- write_entry (procedure groups)
Writer_Options ¶
Writer_Options :: struct { method: archive.Method, // `.Unknown` for LZMA2 level: runtime.Maybe($T=int), // `nil` for the method's default; clamped filter: Filter_Choice, delta_distance: int, // 1 to 256, for `.Delta`; 0 means 1 lzma: runtime.Maybe($T=Options), // LZMA and LZMA2 settings in place of the level's ppmd: runtime.Maybe($T=Properties), // PPMd settings in place of the level's; variant H solid: bool, // Compresses like-set members together in blocks solid_size: i64, // A block's data limit; 0 picks one by method solid_files: int, // A block's member limit; 0 for none solid_order: Solid_Order, creation_time: bool, // Stores creation times access_time: bool, // Stores access times plain_header: bool, // Leaves the header uncompressed, if not encrypted deterministic: bool, // Reproducible: no times, sorted `write_directory` password: string, // AES-256, members and header; not `deterministic` kdf_power: int, // 2^`kdf_power` SHA-256 rounds per key; 0 means 19 unencrypted_header: bool, // With a password, keeps the header's paths readable no_sync: bool, options: compress.Options, }
A writer's settings; the methods are Store, LZMA, LZMA2, PPMd_H, BZip2, Deflate and Deflate64
Related Procedures With Parameters
- create_from_path
- create_from_stream
- update_from_path
- update_from_stream
- create (procedure groups)
- update (procedure groups)
Constants
AES_POWER_DEFAULT ¶
AES_POWER_DEFAULT :: 19
The key-derivation power written when Writer_Options.kdf_power is 0, as 7-Zip does
AES_POWER_MAX ¶
AES_POWER_MAX :: 24
The largest key-derivation power read or written: 2^24 SHA-256 rounds
HEADER_DEPTH_MAX ¶
HEADER_DEPTH_MAX :: 4
HEADER_SIZE_MAX ¶
HEADER_SIZE_MAX :: i64(#config(SEVENZ_HEADER_SIZE_MAX, 1 << 30))
The largest header a reader decodes, in bytes; the decoders' memory limit may lower it
KDF_LIMIT_DEFAULT ¶
KDF_LIMIT_DEFAULT :: 16
How many key derivations a reader allows when Read_Options.max_key_derivations is 0
SFX_SEARCH_MAX ¶
SFX_SEARCH_MAX :: i64(#config(SEVENZ_SFX_SEARCH_MAX, 4 << 20))
UNIX_EXTENSION ¶
UNIX_EXTENSION :: 0x8000
UPDATE_SAVED_MAX ¶
UPDATE_SAVED_MAX :: 64 << 20
An update at a path with a larger old header rewrites the archive instead of appending in place
Variables
This section is empty.
Procedures
close_member ¶
close_member :: proc(reader: io.Stream) {…}
close_reader ¶
close_reader :: proc(r: ^Reader) {…}
Closes a reader and frees its memory
Inputs:
- r The reader; a stream given to
open_from_streamis left open
close_writer ¶
close_writer :: proc(sw: ^Writer) {…}
Closes a writer and frees its memory
Without commit, an update is rolled back and a new archive at a path is discarded; a new
archive on a stream is left unfinished.
Inputs:
- sw The writer; a stream given to
create_from_streamorupdate_from_streamis left open
commit ¶
Finishes the archive: writes the header and, at a path, puts the archive in place
Committing again does nothing. Afterwards, only close is left to call.
Inputs:
- sw An open writer
Returns:
- err The error that stopped the writer earlier, the commit's own error, or
nil
create_from_path ¶
create_from_path :: proc( sw: ^Writer, path: string, options: Writer_Options = {}, allocator := context.allocator, ) -> (err: archive.Error) {…}
Starts a new 7z archive at a path
The archive is written to path plus archive.TEMP_SUFFIX, which commit renames over
path. An existing archive at path is locked meanwhile, except on wasi.
Allocates Using Provided Allocator
Inputs:
- sw The writer;
closeit when done, it is left closed on an error - path Where the archive goes
- options The default method, level, filter and password, solid blocks, and more (default: {})
- allocator (default: context.allocator)
Returns:
- err Bad options as for
create_from_stream,General_Error.Busyif another process holds the archive, an OS error, ornil
create_from_stream ¶
create_from_stream :: proc( sw: ^Writer, s: io.Stream, options: Writer_Options = {}, allocator := context.allocator, ) -> (err: archive.Error) {…}
Starts a new 7z archive on a stream
Allocates Using Provided Allocator
Inputs:
- sw The writer;
closeit when done, it is left closed on an error - s Where the archive goes, from its current position; it must seek, as
commitwrites the start header last - options The default method, level, filter and password, solid blocks, and more (default: {})
- allocator (default: context.allocator)
Returns:
- err
General_Error.Incompatible_OptionsorGeneral_Error.Unsupported_Methodfor bad options,General_Error.Not_Seekable,io.Error.Unsupportedifscan't write, ornil
extract_current_to_dynamic ¶
extract_current_to_dynamic :: proc( it: ^Iterator, output: ^[dynamic]u8, options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Reads the current member's data into a buffer, decompressed and checked
Inputs:
- it The iterator, on the member
iteratereturned last - output Replaced by the member's data, grown with its own allocator; emptied on an error
- options The member's password, if encrypted; else the one given at open (default: {})
Returns:
- err
General_Error.No_Current_Memberifiteratehasn't returned a member, an allocator error, the member's error, ornil
extract_current_to_writer ¶
extract_current_to_writer :: proc( it: ^Iterator, w: io.Stream, options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Writes the current member's data to a writer, decompressed and checked
Inputs:
- it The iterator, on the member
iteratereturned last - w Where the member's data is written
- options The member's password, if encrypted; else the one given at open (default: {})
Returns:
- err
General_Error.No_Current_Memberifiteratehasn't returned a member, or the member's error, ornil
extract_to_dynamic ¶
extract_to_dynamic :: proc( r: ^Reader, handle: archive.Handle, output: ^[dynamic]u8, options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Reads a member's data into a buffer, decompressed and checked
In a solid folder, the folder is decoded from its start up to the member.
Inputs:
- r An open reader
- handle The member, from
File_Info.handleorfind - output Replaced by the member's data, grown with its own allocator; emptied on an error
- options The member's password, if encrypted; else the one given at open (default: {})
Returns:
- err
General_Error.Not_Foundfor a stale handle, an allocator error, the member's error, ornil
extract_to_writer ¶
extract_to_writer :: proc( r: ^Reader, handle: archive.Handle, w: io.Stream, options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Writes a member's data to a writer, decompressed and checked
In a solid folder, the folder is decoded from its start up to the member.
Inputs:
- r An open reader
- handle The member, from
File_Info.handleorfind - w Where the member's data is written
- options The member's password, if encrypted; else the one given at open (default: {})
Returns:
- err
General_Error.Not_Foundfor a stale handle, the member's error, ornil
find ¶
find :: proc( r: ^Reader, path: string, ) -> (fi: archive.File_Info, handle: archive.Handle, ok: bool, err: archive.Error) {…}
Finds a member by path
NOTE: Of several members with the path, the first in storage order is found.
Inputs:
- r An open reader
- path The member's path, ignoring a leading
./or trailing/
Returns:
- fi The member's info; its strings last until
close - handle The member, for
extractandopen_member - ok
falseif no member has the path - err Always
nil: the header was read at open
info ¶
info :: proc(r: ^Reader) -> (info: archive.Archive_Info) {…}
Summarizes an archive
Inputs:
- r An open reader
Returns:
- info Its format and member count, and the method all folders share, else
.Unknown
iterate ¶
Moves to the next member
Inputs:
- it The iterator
Returns:
- fi The member's info; its strings last until
close - index The member's index, as in
fi.handle - ok
falseafter the last member
iterator_create ¶
Creates an iterator over an archive's members, in storage order
Reading members in this order decodes each solid folder once.
Inputs:
- r An open reader
Returns:
- it The iterator; destroy it with
iterator_destroy
iterator_destroy ¶
iterator_destroy :: proc(it: ^Iterator) {…}
iterator_error ¶
Tells why iteration stopped
Inputs:
- it The iterator
Returns:
- path Always empty
- err Always
nil: the header was read at open
lzma_options_7zip ¶
Returns the LZMA settings 7-Zip uses for a level, for Writer_Options.lzma
Inputs:
- level The level, clamped to 0 through 9
Returns:
- options 7-Zip's dictionary size, match finder and match lengths for the level
open_current ¶
open_current :: proc( it: ^Iterator, options: archive.Read_Options = archive.Read_Options{}, ) -> (reader: io.Stream, err: archive.Error) {…}
Opens the current member's data as a reader, which decompresses as it is read
Inputs:
- it The iterator, on the member
iteratereturned last - options The member's password, if encrypted; else the one given at open (default: {})
Returns:
open_from_bytes ¶
open_from_bytes :: proc( r: ^Reader, data: []u8, options: compress.Options = compress.Options{}, allocator := context.allocator, read_options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Opens a 7z archive held in memory
Allocates Using Provided Allocator
Inputs:
- r The reader;
closeit when done, it is left closed on an error - data The archive's bytes; they must stay valid until
close - options Limits and progress callback for the decoders, see
compress.Options(default: {}) - allocator (default: context.allocator)
- read_options The default password, which an encrypted header needs, and the key-derivation limit (default: {})
Returns:
- err A
SevenZ_Errorfor a malformed archive,General_Error.EncryptedorGeneral_Error.Wrong_Passwordfor an encrypted header, ornil
open_from_path ¶
open_from_path :: proc( r: ^Reader, path: string, options: compress.Options = compress.Options{}, allocator := context.allocator, read_options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Opens a 7z archive file
The file is share-locked until close, except on wasi. After a crashed update, the reader sees
the last committed state, as the update's journal records it.
Allocates Using Provided Allocator
Inputs:
- r The reader;
closeit when done, it is left closed on an error - path The archive's path
- options Limits and progress callback for the decoders, see
compress.Options(default: {}) - allocator (default: context.allocator)
- read_options The default password, which an encrypted header needs, and the key-derivation limit (default: {})
Returns:
- err
General_Error.Busywhile a writer holds the file, an OS error, aSevenZ_Errorfor a malformed archive,General_Error.EncryptedorGeneral_Error.Wrong_Passwordfor an encrypted header, ornil
open_from_stream ¶
open_from_stream :: proc( r: ^Reader, s: io.Stream, options: compress.Options = compress.Options{}, allocator := context.allocator, read_options: archive.Read_Options = archive.Read_Options{}, ) -> (err: archive.Error) {…}
Opens a 7z archive from a stream
Allocates Using Provided Allocator
Inputs:
- r The reader;
closeit when done, it is left closed on an error - s The archive; it must read at an offset or seek, report its size, and stay open until
close, which leaves it open - options Limits and progress callback for the decoders, see
compress.Options(default: {}) - allocator (default: context.allocator)
- read_options The default password, which an encrypted header needs, and the key-derivation limit (default: {})
Returns:
- err
General_Error.Not_Seekable, aSevenZ_Errorfor a malformed archive,General_Error.EncryptedorGeneral_Error.Wrong_Passwordfor an encrypted header, ornil
open_member ¶
open_member :: proc( r: ^Reader, handle: archive.Handle, options: archive.Read_Options = archive.Read_Options{}, allocator := context.allocator, ) -> (reader: io.Stream, err: archive.Error) {…}
Opens a member's data as a reader, which decompresses as it is read
In a solid folder, the folder is decoded from its start up to the member.
Allocates Using Provided Allocator
Inputs:
- r An open reader
- handle The member, from
File_Info.handleorfind - options The member's password, if encrypted; else the one given at open (default: {})
- allocator (default: context.allocator)
Returns:
- reader The member's reader; close it with
close_member - err
General_Error.Not_Foundfor a stale handle, the member's error, ornil
read_link ¶
read_link :: proc( it: ^Iterator, options: archive.Read_Options = archive.Read_Options{}, allocator := context.allocator, ) -> (target: string, err: archive.Error) {…}
Reads the current member's link target, which 7z stores as the member's data
Allocates Using Provided Allocator
Inputs:
- it The iterator, on the member
iteratereturned last - options The member's password, if encrypted; else the one given at open (default: {})
- allocator (default: context.allocator)
Returns:
- target The symlink's target, empty for other members;
deleteit - err
General_Error.No_Current_Memberifiteratehasn't returned a member,General_Error.Limit_Exceededpastarchive.LINK_TARGET_MAX, the member's error, ornil
remove_entry ¶
Removes a member, taking effect at commit
Inputs:
- sw A writer from
update_from_path - path The member's path, ignoring a leading
./or trailing/; every member with it goes
Returns:
- err
General_Error.Incompatible_Optionsfor a writer from elsewhere or a member added since the open,General_Error.Not_Found, ornil
rename_entry ¶
Renames a member, taking effect at commit
Inputs:
- sw A writer from
update_from_path - old_path The member's path, ignoring a leading
./or trailing/; every member with it is renamed - new_path Its new path
Returns:
- err
General_Error.Incompatible_Optionsfor a writer from elsewhere or a member added since the open,General_Error.Not_Found,General_Error.Existsifnew_pathis taken, ornil
update_from_path ¶
update_from_path :: proc( sw: ^Writer, path: string, options: Writer_Options = {}, allocator := context.allocator, ) -> (err: archive.Error) {…}
Opens a 7z archive at a path to append, replace, remove or rename members
Appends happen in place, under a journal that rolls them back if the process dies before
commit. A replacement, remove or rename, or an old header over UPDATE_SAVED_MAX bytes, makes
commit write a new archive and rename it over the old one. The archive is locked until
close, except on wasi.
Allocates Using Provided Allocator
Inputs:
- sw The writer;
closeit when done, it is left closed on an error - path The archive's path
- options The defaults for new members, and more;
passwordalso opens the archive (default: {}) - allocator (default: context.allocator)
Returns:
- err Bad options as for
create_from_stream,General_Error.Busyif another process holds the archive, an OS error, aSevenZ_Errorfor a malformed archive, ornil
update_from_stream ¶
update_from_stream :: proc( sw: ^Writer, s: io.Stream, options: Writer_Options = {}, allocator := context.allocator, ) -> (err: archive.Error) {…}
Opens a 7z archive on a stream to append members in place
Allocates Using Provided Allocator
Inputs:
- sw The writer;
closeit when done, it is left closed on an error - s The archive; it must read, write and seek
- options The defaults for new members, and more;
passwordalso opens the archive (default: {}) - allocator (default: context.allocator)
Returns:
- err
General_Error.Not_Seekable, bad options as forcreate_from_stream, aSevenZ_Errorfor a malformed archive, ornil
write_anti_item ¶
write_anti_item :: proc( sw: ^Writer, path: string, directory: bool = false, ) -> (err: archive.Error) {…}
Adds an anti-item: a member that tells 7-Zip, applying this archive as an update, to delete path
Inputs:
- sw An open writer
- path The path to delete
- directory Whether
pathis a directory (default: false)
Returns:
- err
General_Error.Existsfor a path an update already holds, ornil
write_directory ¶
write_directory :: proc( sw: ^Writer, dir: string, prefix: string = "", options: Entry_Options = {}, ) -> (err: archive.Error) {…}
Adds a directory tree: its directories, regular files and symlinks
Other file types are skipped. With deterministic or solid, members go in sorted order; with
solid, files are first grouped by filter, then ordered by solid_order.
Inputs:
- sw An open writer
- dir The directory to add
- prefix Prepended to every member path; when set,
diritself is added, namedprefix(default: "") - options Every member's method, level, filter and password, in place of the writer's, and whether they replace the members an archive being updated has at their paths (default: {})
Returns:
- err The first error, from the walk or from
write_entry_with_info, ornil
write_entry_simple ¶
write_entry_simple :: proc( sw: ^Writer, name: string, data: Entry_Data = nil, options: Entry_Options = {}, ) -> (err: archive.Error) {…}
Adds a regular file, stamped with the current time
Inputs:
- sw An open writer
- name The member's path
- data The file's data, as bytes or a reader (default: nil)
- options This member's method, level, filter and password, in place of the writer's (default: {})
Returns:
- err As
write_entry_with_info
write_entry_with_info ¶
write_entry_with_info :: proc( sw: ^Writer, fi: archive.File_Info, data: Entry_Data = nil, options: Entry_Options = {}, ) -> (err: archive.Error) {…}
Adds a member described by a File_Info
An error after part of the member was written stops the writer: later calls return it.
Inputs:
- sw An open writer
- fi The member's path, type and metadata; a regular file, a directory or a symlink.
sizemay be -1 for a reader of unknown size - data A regular file's data, as bytes or a reader;
nilfor other types (default: nil) - options This member's method, level, filter and password, in place of the writer's, and whether it replaces the members an archive being updated has at its path (default: {})
Returns:
- err
General_Error.Unsupported_Entry,General_Error.Incompatible_Optionsfor data on a non-file or for replacing a member in an update on a stream,General_Error.Existsfor a path an update already holds, unlessreplaceis set and the archive held it when opened,SevenZ_Error.Size_Mismatchif the reader doesn't givefi.sizebytes, ornil
Procedure Groups
create ¶
create :: proc{ create_from_path, create_from_stream, }
Starts a new 7z archive at a path or on a stream
extract ¶
extract :: proc{ extract_to_writer, extract_to_dynamic, }
Extracts a member's data to a writer or into a buffer
extract_current ¶
extract_current :: proc{ extract_current_to_writer, extract_current_to_dynamic, }
Extracts the current member's data to a writer or into a buffer
open ¶
open :: proc{ open_from_path, open_from_bytes, open_from_stream, }
Opens a 7z archive from a path, a byte slice or a stream
update ¶
update :: proc{ update_from_path, update_from_stream, }
Opens a 7z archive at a path or on a stream for changes
write_entry ¶
write_entry :: proc{ write_entry_with_info, write_entry_simple, }
Adds a member described by a File_Info, or a regular file by name
Source Files
- common.odin
- common_os.odin
- crypto.odin
- crypto_hw.odin
- crypto_vaes.odin
- internal.odin
- reader.odin
- sevenz_os.odin
- update.odin
- writer.odin
Generation Information
Generated with odin version dev-2026-11 (vendor "odin") Windows_amd64 @ 2026-11-28 21:05:09.772358800 +0000 UTC