Files
fpk/README.md
T

46 lines
1.3 KiB
Markdown

# fpk (Forlorn Pak)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
Packs a directory tree into a single flat binary archive. C89, no dependencies.
## Building
```bash
./build.sh debug release tools # Unix
build.bat debug release tools # Windows
```
## Usage
```bash
fpack [-o output.fpk] [-p] [-q] [-v] input_dir
funpack [-d output_dir] [-l] [-p] [-q] [-v] input.fpk
```
`fpack` walks `input_dir` recursively (skipping dotfiles) and writes an
archive. If `-o` is omitted, the output name is derived from the input
directory's basename plus `.fpk` (e.g. `assets/` -> `assets.fpk`).
`funpack` extracts (or, with `-l`, lists) the entries in `input.fpk`. If
`-d` is omitted, the output directory is derived from the archive's
basename with `.fpk` stripped (e.g. `assets.fpk` -> `assets/`).
Common flags: `-p` show progress, `-q` suppress the summary line, `-v`
print each entry as it's processed.
```c
#include <fpk/fpk.h>
struct fpk *pak = fpk_open("assets.fpk");
fpk_entry_t *entry = fpk_find(pak, "some/file.bin");
void *data = fpk_read(pak, entry, &size);
fpk_close(pak);
```
See [docs/format.md](docs/format.md) for the on-disk layout.
## License
Mozilla Public License 2.0 (MPL-2.0)