Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

UnauthorizedAccessException occurs for extracting tar file at .NET Framework 4.7.1 #777

Open
ChangjunLim-GGQ opened this issue Nov 7, 2023 · 1 comment
Labels

Comments

@ChangjunLim-GGQ
Copy link

ChangjunLim-GGQ commented Nov 7, 2023

My application working on .NET Framework 4.7.1 needs to extract a tar file.

But System.UnauthorizedAccessException occurs while extracting tar file.

My code is like this

(The version of SharpCompress is 0.34.1)

using SharpCompress.Archives;
using SharpCompress.Common;

using (var archive = ArchiveFactory.Open(tarFilePath))
{
    foreach (var entry in archive.Entries)
    {
        if (!entry.IsDirectory)
        {
            entry.WriteToDirectory(outputDirectory, new ExtractionOptions()
            {
                ExtractFullPath = true,
                Overwrite = true
            });
        }
    }
}

Since there is no problem with the other library 'SharpZipLib' or System.Formats.Tar(on .NET 7), I think there is no problem with access permission on the file or directory.

@Erior
Copy link
Contributor

Erior commented Dec 4, 2023

The test suite does extractions with net462, do you have an example tar file that we can play with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants