Home

Awesome

ILAR

Simple archive format

TODO

Dependencies

Building and running

./builddir/ilar -c/--create -t/--type {gz|bz2|xz} -f/--file myarchive.ilar.ext myfile.txt mydir mysymlink.pdf
./builddir/ilar -x/--extract -f/--file myarchive.ilar -d/--directory myoutdir/
./builddir/ilar -l/--list -f/--file myarchive.ilar
./builddir/ilar -h/--help
./builddir/ilar -v/--version

Specifications

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
};