mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-08 05:27:04 +00:00
Is there a way to exclude files from tar.gz archive? #376
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DSR-Labs on GitHub (Sep 15, 2019).
Hey,
Is there a way to exclude files from tar.gz archive?
If in my directory the folders 1, 2, 3 and the files are 4, 5, 6, then I would like to exclude for example the folder 2 and the file 5 from the archive.
Thanks
@adamhathcock commented on GitHub (Sep 17, 2019):
You need to write your own code when adding files to an archive in that case. I provided some convenience extension methods for common use-cases but they were never meant to be exhaustive. Adding files with FileInfo or Streams should be the primary way to create a archives.