Miscellaneous OpenComputers stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
XeonSquared f7ee3e3250 Updated README to include libmtar documentation and added type annotations to libmtar 6 months ago
..
OpenOS/usr moved the unarchive function out of libmtar, making it significantly simpler and more compact, and allowing implementations to deal with the implementation details 6 months ago
README.md Updated README to include libmtar documentation and added type annotations to libmtar 6 months ago
libmtar.lua Updated README to include libmtar documentation and added type annotations to libmtar 6 months ago

README.md

mtar - Minitel Archiver

mtar is a file format for storing multiple files in a single file, much like tar, cpio or zip.

File format

mtar archive files consist of a number of file entries, in the following format:

  • 2 bytes file name length
  • the file name
  • 2 bytes file content length
  • the file contents

Archives are terminated either by the end of file, or a record with a name length of zero.

libmtar

libmtar is the reference implementation of mtar. It provides two functions:

  • libmtar.genHeader(string: name, number: len): string
    Generates an mtar file header for a file called name that is len bytes long.
  • libmtar.iter(table: stream): function
    Given buffer stream, returns an iterator suitable for use with for that returns, for each iteration, the file name, a function to read from the file, and the length of the file.