Simple archive format
- Regular files
- Directories
- Symlinks
- File modes
- Create
- List
- Extract
- GZIP
- BZIP2
- LZMA
- Meson
- Ninja
- C++ compiler
- Boost iostreams (libboost-iostreams-dev on debian based distros)
meson builddir
ninja -C builddir
- Create ILAR archive: (To use compression, add .gz, .bz2 or .xz to file name or use -t/--type. Possible values are gz, bz2 and xz)
./builddir/ilar -c/--create -t/--type {gz|bz2|xz} -f/--file myarchive.ilar.ext myfile.txt mydir mysymlink.pdf
- Extract ILAR archive:
./builddir/ilar -x/--extract -f/--file myarchive.ilar -d/--directory myoutdir/
- List files in ILAR archive:
./builddir/ilar -l/--list -f/--file myarchive.ilar
- Show help
./builddir/ilar -h/--help
- Show version
./builddir/ilar -v/--version
ILAR archive consists of consecutive file headers and contents.
First file starts at offset 0x00
.
It's contents is at offset + sizeof(fileheader)
(274 bytes).
To get the next file header, add sizeof(fileheader) + file->size
to offset.
name
and link
are null terminated
1st file header -> 1st file contents -> 2nd file header -> 2nd file contents
File header structure:
#define PATH_LENGTH 128
#define ILAR_SIGNATURE "ILAR"
struct fileheader
{
char signature[5]; // Should be ILAR_SIGNATURE
char name[PATH_LENGTH]; // File name with absolute path
char link[PATH_LENGTH]; // Contains relative path to symlinked file
uint64_t size; // Size of file contents in bytes
uint8_t type; // File type
uint32_t mode; // File mode
} __attribute__((packed));
File types:
enum filetypes
{
ILAR_REGULAR = 0,
ILAR_DIRECTORY = 1,
ILAR_SYMLINK = 2
};