Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: .Zip or .Rar

$
0
0

Note this is a .NET Framework question and has nothing specifically to do with any Micro Focus product. The answer would be the same for programs written in any .NET language.

If you create a GZipStream and write its output to a file, what you get is a gzip file, which is not a zip file. (Gailly and Adler did the world no favors when they named gzip, since it's obviously confusing.)

The zip file format is a compound-file or archive-file format that includes a directory of contents, plus data that may be compressed with various algorithms, most often the "Deflate" algorithm.

Gzip, on the other hand, is just Deflate-compressed data with a trivial envelope. It does not have a directory, and consequently can't (by itself) represent a collection of compressed files. The Wikipedia articles and any number of other sources provide more detail.

The .NET Framework 4.5 offers the ZipArchive class, which you can use to create zip files. If you're using an older version of .NET, there are various free and commercial zip class libraries for .NET.

The RAR file format can (legally) only be created by commercial software such as WinRAR. There are legal free RAR decompressors / extractors, but you can't create RAR files without using a commercial package.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>