Manipulate an Archive in memory with PHP (without creating a temporary file on disk)

I had the same problem but finally found a somewhat obscure solution and decided to share it here. I came accross the great zip.lib.php/unzip.lib.php scripts which come with phpmyadmin and are located in the “libraries” directory. Using zip.lib.php worked as a charm for me: require_once(LIBS_DIR . ‘zip.lib.php’); … //create the zip $zip = new zipfile(); … Read more

Compression formats with good support for random access within archives? [closed]

Take a look at dictzip. It is compatible with gzip and allows coarse random access. An excerpt from its man page: dictzip compresses files using the gzip(1) algorithm (LZ77) in a manner which is completely compatible with the gzip file format. An extension to the gzip file format (Extra Field, described in 2.3.1.1 of RFC … Read more

Zip folder in C#

This answer changes with .NET 4.5. Creating a zip file becomes incredibly easy. No third-party libraries will be required. string startPath = @”c:\example\start”; string zipPath = @”c:\example\result.zip”; string extractPath = @”c:\example\extract”; ZipFile.CreateFromDirectory(startPath, zipPath); ZipFile.ExtractToDirectory(zipPath, extractPath);

How do I extract a tar file in Java?

You can do this with the Apache Commons Compress library. You can download the 1.2 version from http://mvnrepository.com/artifact/org.apache.commons/commons-compress/1.2. Here are two methods: one that unzips a file and another one that untars it. So, for a file <fileName>tar.gz, you need to first unzip it and after that untar it. Please note that the tar archive … Read more