Expand description
Library support for inspecting, extracting, creating, and updating Bethesda archives.
dream_archivetool wraps the dream_archive crate behind a small, application-oriented API that is
shared by the CLI and optional Lua bindings. The main entry point is ArchiveTool; callers doing
repeated operations against one archive can use OpenArchive to keep the archive loaded.
dream_archive is re-exported so embedding applications can register the matching lower-level Lua
API without adding a second dependency just to spell the same crate name. That re-export is part
of this crate’s embedding compatibility surface; dream_archive upgrades can affect downstream
Lua/module integration even when dream_archivetool policy APIs do not change.
§Example
use dream_archivetool::{ArchiveTool, CreateOptions};
let archive = ArchiveTool::open("Morrowind.bsa")?;
let entries = archive.list()?;
let bytes = archive.read_entry("icons/gold.dds")?;
let count = ArchiveTool::create("out.bsa", "input_dir", &CreateOptions::default())?;Extraction rejects absolute paths, parent-directory traversal, NUL bytes, and colon-containing
components. Disk extraction streams payloads into temporary files before replacing the
destination, but it is not an openat-style jail against pre-existing symlinks in the output
tree. Archive creation and update reject input symlinks encountered during collection unless
follow_symlinks is explicitly enabled; callers must keep input trees trusted and stable during
the write. Paths are preflighted before handing file/archive-entry sources to dream_archive
builders, including BA2 DX10 texture preservation where the backend can copy native chunks.
Enable the luau feature for the Luau bindings: an l3i
extension (dream.archivetool, module @dream/archivetool) that requires dream.archive
and adds the policy operations to dream.archive.Archive itself. The crate never creates
a VM; see the luau module. lua is the old name of the same feature.
Re-exports§
pub use archive::ArchiveInfo;pub use archive::ArchiveTool;pub use archive::Ba2Info;pub use archive::OpenArchive;pub use archive::Tes4Info;pub use create::AddOptions;pub use create::AddPlan;pub use create::ArchivePlanAction;pub use create::ArchivePlanEntry;pub use create::ArchivePlanOperation;pub use create::Ba2ArchiveKind;pub use create::Ba2Version;pub use create::CreateOptions;pub use create::CreatePlan;pub use create::Tes4Version;pub use diff::DiffChange;pub use diff::DiffComparison;pub use diff::DiffEntry;pub use diff::DiffEntryState;pub use diff::DiffOptions;pub use diff::DiffReport;pub use diff::diff_archives;pub use entry::ArchiveEntry;pub use error::ArchiveError;pub use error::Result;pub use extract::ExtractAllOptions;pub use extract::ExtractAllPlan;pub use extract::ExtractOptions;pub use extract::ExtractPlanAction;pub use extract::ExtractPlanEntry;pub use extract::ExtractPlanOperation;pub use extract::ExtractSummary;pub use extract::OverwriteMode;pub use format::ArchiveFormat;pub use path::decode_archive_path_hex;pub use path::encode_archive_path_hex;pub use path::normalize_archive_path_bytes;pub use verify::VerifyOptions;pub use verify::VerifyPathIssue;pub use verify::VerifyReport;pub use verify::verify_archive;pub use dream_archive;