Closed
Description
Steps to reproduce
1.Make a request to the server to download the gziped file
2. Use all possible examples from GZip and Tar Samples to try to decompress/extract contents
3. On unity editor and Android all works fine using the method below
public static void ExtractNestedTar(string gzArchiveName, string destFolder, bool deleteOriginal, Func<string, string> fileVersionExtractor)
{
var tmp = Path.Combine(destFolder, "tmp");
using (Stream inStream = File.OpenRead(gzArchiveName))
using (TarArchive tarArchive = TarArchive.CreateInputTarArchive(inStream)) {
tarArchive.ExtractContents(tmp);
System.Array.ForEach(new DirectoryInfo(tmp).GetDirectories(),
fl => Debug.Log($"Compressor: TMP file name {fl.Name}"));
foreach (var f in new DirectoryInfo(tmp).GetFiles("*.tar")) {
using (var s = f.OpenRead())
using (var t = TarArchive.CreateInputTarArchive(s)) {
string fileName = fileVersionExtractor.Invoke(f.Name);
t.ExtractContents(Path.Combine(destFolder, fileName));
}
}
}
if (!deleteOriginal) return;
File.Delete(gzArchiveName);
Directory.Delete(tmp, true);
}
Expected behavior
Be able to extract contents from tar.gz file on IOS
Actual behavior
When trying to parse header on IOS devices the checksum is invalid since checksum obtained from ParseOctal and the one obtained from MakeCheckSum are different.
I'm attaching the tar.gz file I got from unity and from IOS (strangely both have different sizes) I'm thinking that maybe from IOS side the gzipped file gets decompressed and encoded in some way not supported, but it's just a hypothesis.
unityFile.tar.gz
IOSFile.tar.gz
Version of SharpZipLib
v1.2.0
Obtained from (only keep the relevant lines)
- Downloaded from GitHub
Metadata
Metadata
Assignees
Labels
No labels