0.0.4 • Published 2 years ago

com.kagekirin.targzreader v0.0.4

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

TarGzReader

A relatively simple and straightforward class to read the file data from a .tar archive, with or without gz compression.

Notes

  • PaxHeader entries are skipped, since we mostly target to get the entries data, not their metadata.

More on PaxHeaders.

Usage

The intended use-case is the retrieval of the contained files, e.g. by an asset importer.

As an example, 3 ScriptedImporters are part of the repo, BUT NOT of the package.

.tar file

using (var tar = new Tar(assetPath))
{
    contents = new List<string>(tar.dictionary.Keys);
}

.tgz or .tar.gz file

using (var tar = new Tar(GzReader.ExtractGz(assetPath)))
{
    contents = new List<string>(tar.dictionary.Keys);
}