I am using the zip package - archive/zip - Go Packages having the issue with
OpenReader() file where file has more capcity more than 80gb Then
I am getting
this error
zip: not a valid zip file
exit status 1
but same in 700 MB is working extracting
Are you certain it’s a problem with the file size and not a malformed Zip archive? You could open an issue on the Go issue tracker. You could also try a different library like mholt/archives to see if it’s less picky about the format. Just for example the code in archive/zip
has comments like this:
if strings.HasSuffix(f.Name, "/") {
// The ZIP specification (APPNOTE.TXT) specifies that directories, which
// are technically zero-byte files, must not have any associated file
// data. We previously tried failing here if f.CompressedSize64 != 0,
// but it turns out that a number of implementations (namely, the Java
// jar tool) don't properly set the storage method on directories
// resulting in a file with compressed size > 0 but uncompressed size ==
// 0. We still want to fail when a directory has associated uncompressed
// data, but we are tolerant of cases where the uncompressed size is
// zero but compressed size is not.
if f.UncompressedSize64 != 0 {
return &dirReader{ErrFormat}, nil
} else {
return &dirReader{io.EOF}, nil
}
}
So it could be that whatever archiver you’re using is doing something they aren’t expecting and it’s throwing that error, etc. Do you know what archiver created the archive you’re trying to unzip? Also could be file entry limit:
The original .ZIP format had a 4 GB (232 bytes) limit on various things (uncompressed size of a file, compressed size of a file, and total size of the archive), as well as a limit of 65,535 (216-1) entries in a ZIP archive. In version 4.5 of the specification (which is not the same as v4.5 of any particular tool), PKWARE introduced the “ZIP64” format extensions to get around these limitations, increasing the limits to 16 EB (264 bytes). In essence, it uses a “normal” central directory entry for a file, followed by an optional “zip64” directory entry, which has the larger fields.[40]
Source: ZIP (file format) - Wikipedia.