??????????? ??????? TAR.GZ ? C#

???? ?? ?????? ?????????? ???????????? ?????????? ??????? Tar.gz ? ???? ?????, ???????? ??? ??????.

????????

API Aspose.ZIP ????????????? ????? TarArchive ??? ?????????? ? ??????????? ??????? Tar ?? ??????? ??? ??? ????.�?? ????? ??????? ????? ? ??????, ?? ???????? ??? ? ????????????? ?????????, ? ????? ???????? ??? ?????? ? ???????????? ????? Tar.

?????????, ??? ? ??? ?????????? ??????????? ?????? ??? ???????? ??????????? ???? ???????.

??????? ??????

? ????????? ??????? ???? ????????, ??? ??????? ?????? ?? ?????????? ??????? Tar.gz ? ????? ?? ????????? ?? ? ????? tar. ?? ??????? ??? ? ?????? ?? gz, ????????? ????? SaveGzipped.

 1    string[] archivesPaths = new string[] { "data/first.tar.gz",
 2        "data/second.tar.gz", "data/third.tar.gz" };
 3    TarArchive[] archives = new TarArchive[archivesPaths.Length];
 4
 5    using (TarArchive mergred = new TarArchive())
 6    {
 7        for (int i = 0; i < archivesPaths.Length; i++)
 8        {
 9            TarArchive a = TarArchive.FromGZip(archivesPaths[i]);
10            archives[i] = a;
11            foreach (TarEntry entry in a.Entries)
12                mergred.CreateEntry(entry.Name, entry.Open());
13        }
14
15        mergred.SaveGzipped("merged.tar.gz");
16
17        for (int i = 0; i < archivesPaths.Length; i++)
18        {
19            archives[i].Dispose();
20        }
21    }

??????????? ?????? ??? ?????? ???????

?? ?????? ???????????? ??? ?? ?????? ??? ??????????? tar.lz, tar.xz, tar.z.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.