Merge any number of Tar.gz archives

If you want to combine arbitrary numbers of Tar.gz archives into single archive read this article.

Description

Aspose.ZIP API provides  TarArchive class to extract and compose Tar archives, with or without compression. We can extract an archive to memory without saving it into intermediate storage and pass its entries to combined Tar archive right away.

Make sure you have enough virtual memory to keep content of all entries.

Transfer an Entry

The following code example demonstrates how to extract entries from several Tar.gz archives and immediately put it to tar archive. We compress it to gz in memory using SaveGzipped method.

Similar approach for other archives

You can use the same approach to combine tar.lz, tar.xz, tar.z.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.