Home

Awesome

CC-Archive

Various archiving/compression programs and libraries for ComputerCraft. All libraries should be loaded with require(). Everything in this repository is under public domain unless otherwise specified, though it would be nice if you link back to this repo if you use one of the libraries.

ar

Program & library for accessing *.a files. Uses System V/GNU-style archives.

Library

CLI

Functions similarly to GNU/BSD ar, with the following options:

commands:
  d            - delete file(s) from the archive
  p            - print file(s) found in the archive
  q            - quick append file(s) to the archive
  r            - replace existing or insert new file(s) into the archive
  t            - display contents of archive
  x            - extract file(s) from the archive
modifiers:
  [c]          - do not warn if the library had to be created
  [T|f]        - truncate file
  [u]          - only replace files that are newer than current archive contents
  [v]          - be verbose

archive

Library for creating ComputerCraft-friendly archives.

Format

Archives are gzipped serialized Lua tables with the file name as the key and the file/directory data as the value. File data is represented by a string with the data while directory data is represented as a table with the same format as the root directory.

Archives returned by the library are represented as filesystem objects with the same methods as the fs library, with two extra methods: write(path) writes the archive to a file, and extract(path) extracts the file in the archive to a directory.

Library

arlib

Library for loading libraries from an ar archive.

Library

gzip

Program that implements GNU gzip in CC.

CLI

Usage: gzip [OPTION]... [FILE]
Compress or uncompress FILEs (by default, compress FILES in-place).

  -c, --stdout      write on standard output, keep original files unchanged
  -d, --decompress  decompress
  -f, --force       force overwrite of output file
  -h, --help        give this help
  -k, --keep        keep (don't delete) input files
  -l, --list        list compressed file contents
  -t, --test        test compressed file integrity
  -v, --verbose     verbose mode
  -V, --version     display version number
  -1, --fast        compress faster
  -9, --best        compress better

With no FILE, or when FILE is -, read standard input.

LibDeflate

Modified version of LibDeflate that works with ComputerCraft. See the official repo for more details.

muxzcat

Version of pts's muxzcat program ported to Lua. Decompresses XZ/LZMA files. Licensed under GPL v2.0 or later.

Library

tar

Program & library for accessing tar archives. Uses UStar-style archives.

Library

CLI

Usage: tar [OPTION...] [FILE]...
CraftOS 'tar' saves many files together into a single tape or disk archive, and
can restore individual files from the archive.

Examples:
  tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.
  tar -tvf archive.tar         # List all files in archive.tar verbosely.
  tar -xf archive.tar          # Extract all files from archive.tar.

 Local file name selection:

      --add-file=FILE        add given FILE to the archive (useful if its name
                             starts with a dash)
  -C, --directory=DIR        change to directory DIR
      --no-null              disable the effect of the previous --null option
      --no-recursion         avoid descending automatically in directories
      --null                 -T reads null-terminated names; implies
                             --verbatim-files-from
      --recursion            recurse into directories (default)
  -T, --files-from=FILE      get names to extract or create from FILE
  
 Main operation mode:

  -A, --catenate, --concatenate   append tar files to an archive
  -c, --create               create a new archive
  -d, --diff, --compare      find differences between archive and file system
      --delete               delete from the archive (not on mag tapes!)
  -r, --append               append files to the end of an archive
  -t, --list                 list the contents of an archive
  -u, --update               only append files newer than copy in archive
  -x, --extract, --get       extract files from an archive

 Overwrite control:

  -k, --keep-old-files       don't replace existing files when extracting,
                             treat them as errors
      --overwrite            overwrite existing files when extracting
      --remove-files         remove files after adding them to the archive
  -W, --verify               attempt to verify the archive after writing it

 Device selection and switching:

  -f, --file=ARCHIVE         use archive file or device ARCHIVE
   
 Device blocking:

  -i, --ignore-zeros         ignore zeroed blocks in archive (means EOF)
  
 Compression options:

  -z, --gzip, --gunzip, --ungzip   filter the archive through gzip
  
 Local file selection:

  -N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE
                             only store files newer than DATE-OR-FILE
  
 Informative output:

  -v, --verbose              verbosely list files processed
  
 Other options:

  -?, --help                 give this help list
      --usage                give a short usage message
      --version              print program version

unxz

Extracts an XZ file.

CLI

Usage: unxz [OPTION]... [FILE]...
Decompress FILEs in the .xz format.

  -k, --keep         keep (don't delete) input files
  -f, --force        force overwrite of output file
  -c, --stdout       write to standard output and don't delete input files
  -h, --help         display this help and exit
  -V, --version      display the version number and exit

Report bugs to https://github.com/MCJack123/CC-Archive/issues.
Uses JackMacWindows's Lua port of muxzcat. Licensed under GPL v2.0.