Librarium
Library and binaries for the reading, creating, and modification of cpio archives.
Library
Compiler support: requires rustc 1.85+
Add the following to your Cargo.toml file:
[]
= "0.4.0"
Read
use CString;
use Cursor;
use ;
use ;
let mut file = open.unwrap;
let mut archive = from_reader_with_offset.unwrap;
// extract bytes from all in archive
for object in &archive.objects.inner
Write
use CString;
use Cursor;
use File;
use ;
let file = create.unwrap;
let mut writer = new;
// A
let a_data = "a\n".as_bytes;
let a_header = Header ;
writer.push_file.unwrap;
// write to archive
writer.write.unwrap;
Binaries
Compiler support: requires rustc 1.85+
These are currently under development and are missing features, MR's welcome!
To install, run cargo install librarium-cli --locked, or download from the
latest github release.
See --help for more information.
uncpio-librarium
tool to extract and list cpio filesystems
Usage: uncpio-librarium [OPTIONS] <ARCHIVE> <FORMAT>
Arguments:
<ARCHIVE> cpio path
<FORMAT> [possible values: odc, newc]
Options:
-o, --offset <BYTES> Skip BYTES at the start of FILESYSTEM [default: 0]
-d, --dest <PATHNAME> Extract to [PATHNAME] [default: out]
-h, --help Print help
-V, --version Print version
Development
All patches/merge requests are welcome! See the development guide for more details. DEVELOPMENT.md.