Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

It's not possible to tar files starting with "system" in the file name. #859

Open
mrconter1 opened this issue Feb 8, 2024 · 0 comments
Open
Labels
bug tar Related to TAR file format

Comments

@mrconter1
Copy link

Describe the bug

I am trying to tar a folder that contains a file that is called "system.xml". It doesn't work. If I however change the name of the file to "ssystem.xml" it works. But if I choose the name "system2.xml" or "system.txt" it doesn't work. So in other words, when I try to create an archive of files and one of the files starts with "system" it isn't added to the archive. Here is my code:

        static Task<string> CompressLocalTest()
        {
            return Task.Run(() =>
            {
                string sourcePath = @"C:\Users\bla\Documents\Backup";
                string destPath = @"C:\Users\bla\Documents\ssss\dd\fck.tar";

                using (var outStream = File.Create(destPath))
                {
                    var tarArchive = TarArchive.CreateOutputTarArchive(outStream);
                    AddDirectoryFilesToTar(tarArchive, sourcePath, true);
                }

                return destPath;
            });
        }

        public static void AddDirectoryFilesToTar(TarArchive tarArchive, string sourceDirectory, bool recurse)
        {
            TarEntry tarEntry = TarEntry.CreateEntryFromFile(sourceDirectory);
            tarArchive.WriteEntry(tarEntry, recurse);
        }

Reproduction Code

No response

Steps to reproduce

  1. Make a folder that contains a file that has a name that starts with "system"
  2. Try to make a tar archive using the SharpZipLib code.

Expected behavior

It should add the system.xml file like any other file. When I for instance tar with 7zip it works.

Operating System

Windows

Framework Version

.NET Framework 4.x

Tags

Tar

Additional context

I am using SharpZipLib 1.4.2.

@mrconter1 mrconter1 added the bug label Feb 8, 2024
@github-actions github-actions bot added the tar Related to TAR file format label Feb 8, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug tar Related to TAR file format
Projects
None yet
Development

No branches or pull requests

1 participant