Module jls.util.zip.tar

Provide tar file utility.

Tar files are archives that allow to store multiple files.

Functions

extractStreamTo (directory[, decompress]) Returns a jls.io.StreamHandler that will extracts the tar content into the specified directory.
extractFileTo (file, directory) Extracts the specified file into the specified directory.


Functions

extractStreamTo (directory[, decompress])
Returns a jls.io.StreamHandler that will extracts the tar content into the specified directory.

Parameters:

  • directory the directory to extract to, as a jls.io.File or a string directory name
  • decompress boolean true to indicate that the stream is compressed using gzip (optional)

Returns:

    the jls.io.StreamHandler

Usage:

    local tar = require('jls.util.zip.tar')
    local FileStreamHandler = require('jls.io.streams.FileStreamHandler')
    
    local sh = tar.extractStreamTo('.')
    FileStreamHandler.readAllSync('test.tar', sh)
extractFileTo (file, directory)
Extracts the specified file into the specified directory.

Parameters:

  • file the tar file to extract, as a jls.io.File or a string file name
  • directory the directory to extract to, as a jls.io.File or a string directory name

Usage:

    local tar = require('jls.util.zip.tar')
    tar.extractFileTo('test.tar', '.')
generated by LDoc 1.4.6