Introduction
filearco_rs is a Rust crate for creating and reading a simple archive format. It was designed for game development, but can be used for other purposes.
It also includes a command-line utility, filearco, that writes all the files in a directory hierarchy into an archive.
Example
This example demonstrates creating a FileArco version 1 archive file and retrieving a text file from that same archive.
extern crate filearco;
use Path
File Format
Version 1
NOTE: All data is stored in LSB (i.e. "little endian") byte order.
// Ofset 0x00: Start of file
// Offset 0x30:
header_checksum: u64 // CRC64-ISO checksum of Header
// Offset 0x38:
// Start of serialized HashMap<String, Entry>
number_of_entries: u64
// Offset 0x40: Start of first file's metadata
file_name_length: u64, // Length of file path (in bytes)
file_name: // File path as raw UTF-8 string
// Contents of file as byte array
// NOTE: Each contents array is followed by enough zeros to make the next file
// contents array start at a multiple of header.page_size
Platforms
filearco_rs should Work on Windows and any POSIX compatible system (Linux, Mac OSX, etc.).
filearco_rs is continuously tested on:
x86_64-unknown-linux-gnu(Linux)i686-unknown-linux-gnux86_64-unknown-linux-musl(Linux w/ MUSL)i686-unknown-linux-muslx86_64-apple-darwin(Mac OSX)i686-apple-darwinx86_64-pc-windows-msvc(Windows)i686-pc-windows-msvcx86_64-pc-windows-gnui686-pc-windows-gnu
filearco_rs is continuously cross-compiled for:
arm-unknown-linux-gnueabihfaarch64-unknown-linux-gnumips-unknown-linux-gnuaarch64-unknown-linux-musli686-linux-androidx86_64-linux-androidarm-linux-androideabiaarch64-linux-androidi386-apple-iosx86_64-apple-iosi686-unknown-freebsdx86_64-unknown-freebsdx86_64-unknown-netbsdasmjs-unknown-emscripten