Skip to content

Simple C# reader for .tar, .tar.gz or .tgz files that integrates into Unity

License

Notifications You must be signed in to change notification settings

KageKirin/TarGzReader

Repository files navigation

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

About

Simple C# reader for .tar, .tar.gz or .tgz files that integrates into Unity

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages