1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 20:28:06 +11:00
collapseos/tools/cfspack
Virgil Dupras 359991c005 cfspack: fix compilation error
Some compilers don't like assigning stdout statically.
2019-12-31 15:12:17 -05:00
..
.gitignore tools/emul/shell: add filesystem support 2019-05-12 11:20:31 -04:00
cfs.h cfspack: make into a library 2019-12-31 13:57:52 -05:00
cfspack.c cfspack: make into a library 2019-12-31 13:57:52 -05:00
cfsunpack.c tools/cfsunpack: new tool 2019-06-17 15:21:05 -04:00
libcfs.c cfspack: fix compilation error 2019-12-31 15:12:17 -05:00
Makefile cfspack: make into a library 2019-12-31 13:57:52 -05:00
README.md cfspack: allow multiple patterns and multiple paths in args 2019-12-11 21:08:46 -05:00

cfspack

A tool/library to pack files into a CFS blob and unpack a CFS blob into a directory.

Usage

To pack a directory into a CFS blob, run:

cfspack /path/to/directory

The blob is spit to stdout. If there are subdirectories, they will be prefixes to the filenames under it.

cfspack takes optional -p pattern arguments. If specified, only files matching at least one of the patterns ("fnmatch" style") will be included.

If path is a file, a CFS with a single file will be spit and its name will exclude the directory part of that filename.

The chain being spitted is always ended with a "stop block" (a zero-allocation block that stops the CFS chain). You can call cfspack with no argument to get only a stop block.

The program errors out if a file name is too long (> 26 bytes) or too big (> 0x10000 - 0x20 bytes).

To unpack a blob to a directory:

cfsunpack /path/to/dest < blob

If destination exists, files are created alongside existing ones. If a file to unpack already exists, it is overwritten.