Is there a way to exclude files from tar.gz archive? #376

Open
opened 2026-01-29 22:10:57 +00:00 by claunia · 1 comment
Owner

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

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
claunia added the question label 2026-01-29 22:10:57 +00:00
Author
Owner

@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.

@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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#376