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-gnu
x86_64-unknown-linux-musl
(Linux w/ MUSL)i686-unknown-linux-musl
x86_64-apple-darwin
(Mac OSX)i686-apple-darwin
x86_64-pc-windows-msvc
(Windows)i686-pc-windows-msvc
x86_64-pc-windows-gnu
i686-pc-windows-gnu
filearco_rs
is continuously cross-compiled for:
arm-unknown-linux-gnueabihf
aarch64-unknown-linux-gnu
mips-unknown-linux-gnu
aarch64-unknown-linux-musl
i686-linux-android
x86_64-linux-android
arm-linux-androideabi
aarch64-linux-android
i386-apple-ios
x86_64-apple-ios
i686-unknown-freebsd
x86_64-unknown-freebsd
x86_64-unknown-netbsd
asmjs-unknown-emscripten