We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
var destinationFile = Path.Combine(Path.GetTempPath(), "output.tar"); using var outStream = File.OpenWrite(destinationFile); using var tarArchive = TarArchive.CreateOutputTarArchive(outStream); var srcPath= "/tmp/subpath1"; tarArchive.RootPath = srcPath; var tarEntry = TarEntry.CreateEntryFromFile(srcPath); tarArchive.WriteEntry(tarEntry, recurse: true);
Note this happens on Linux and not on Windows
$ tar -tf /tmp/output.tar subpath2/file1 subpath2/subpath3/file2
$ tar -tf /tmp/output.tar tmp/subpath1/subpath2/file1 tmp/subpath1/subpath2/subpath3/file2
1.3.1
The text was updated successfully, but these errors were encountered:
Any known workarounds?
Sorry, something went wrong.
Well there is #582 which fixes this issue in most scenarios…
@asleire The easiest workaround right now is to remove the initial slash from the TarArchive.RootPath (not the CreateEntryFromFile argument):
TarArchive.RootPath
var destinationFile = Path.Combine(Path.GetTempPath(), "output.tar"); using var outStream = File.OpenWrite(destinationFile); using var tarArchive = TarArchive.CreateOutputTarArchive(outStream); var srcPath= "/tmp/subpath1"; tarArchive.RootPath = srcPath.TrimStart('/'); var tarEntry = TarEntry.CreateEntryFromFile(srcPath); tarArchive.WriteEntry(tarEntry, recurse: true);
Successfully merging a pull request may close this issue.
Steps to reproduce
Note this happens on Linux and not on Windows
Expected behavior
Actual behavior
Version of SharpZipLib
1.3.1
Obtained from (only keep the relevant lines)
The text was updated successfully, but these errors were encountered: