IRONSOFTWAREHOME
Create TAR
using IronZip;

// Create an empty TAR
using (var archive = new IronTarArchive())
{
    // Add files to the TAR
    archive.Add("./assets/image1.jpg");
    archive.Add("./assets/image2.jpg");
    archive.Add("./assets/image3.jpg");

    // Export the TAR
    archive.SaveAs("output.tar");
}
Imports IronZip

' Create an empty TAR
Using archive = New IronTarArchive()
    ' Add files to the TAR
    archive.Add("./assets/image1.jpg")
    archive.Add("./assets/image2.jpg")
    archive.Add("./assets/image3.jpg")

    ' Export the TAR
    archive.SaveAs("output.tar")
End Using
NuGet Download
PM > Install-Package IronZip
Create TAR

Create TAR

Tar, which stands for "Tape Archive," is a file archiving format and utility commonly used in Unix and Linux systems. It allows users to bundle multiple files and directories into a single archive without compression, effectively preserving the file structure and metadata. Tar is often used in conjunction with compression utilities like gzip or bzip2 to create compressed archives, which are frequently utilized for data backups and software distribution.

With IronZIP, we can easily automate these processes to mitigate human errors and significantly improve efficiency, making the entire workflow more practical and manageable.

Creating an Empty Tar Archive

Initially, we import the IronZip namespace to access the library. Next, we create a new Tar archive by utilizing the IronTarArchive constructor within a using statement, which sets up an empty Tar archive.

Adding Files to the Empty Archive

Before finalizing the save, we can include files using the Add method by supplying their absolute paths. You have the option to add either single or multiple files to the archive. The types of files you can incorporate range from images and documents (like docx and PDF) to audio files (such as MP3 and WAV), and even Tar archives, allowing you to create a compressed archive within another archive.

For more information regarding the list of compatible files that you can add, please refer to the documentation here.

Saving and Exporting it

We finally save the archive and export it using the SaveAs method, saving it as output.tar.

Explore our Zip File Guide for Creation & Extraction
View on GitHub

Ready to Get Started?

Nuget Downloads 23,187Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required