Empty .tar.gz file when using example code to create a new archive #491
Unanswered
heavyflames
asked this question in
General
Replies: 1 comment
-
I presume you are using the example methods and basically doing this: CreateTarGZ(@"c:\tmp\output.tar.gz", @"C:\tmp\staging\vpd"); I don't see why that would not include your file, but you can log what files are found to perhaps better debug what is going on: // Write each file to the tar.
string[] filenames = Directory.GetFiles(sourceDirectory);
foreach (string filename in filenames)
{
Console.WriteLine($"Adding {filename}...");
tarEntry = TarEntry.CreateEntryFromFile(filename);
tarArchive.WriteEntry(tarEntry, true);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using the example found here :
https://github.com/icsharpcode/SharpZipLib/wiki/GZip-and-Tar-Samples#createTGZ
I have a folder structure like C:\tmp\staging\vpd
and I have 1 file in that folder.
But when trying to create a .tar.gz file based on that folder the .tar.gz file is empty.
But If I step out one folder, to c:\tmp\staging then I get a .tar.gz that contains all the folders and files from there.
Why is that?
Beta Was this translation helpful? Give feedback.
All reactions