mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
tar file throwing "Rar signature not found" #442
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 @PaulMcGuinness on GitHub (Mar 4, 2021).
I'm getting the following error on a .tar file
SharpCompress.Common.InvalidFormatException: 'Rar signature not found'
When it's not a 'rar' file at all.....
Is there an option to define the type instead of letting it decide itself?
@adamhathcock commented on GitHub (Mar 5, 2021):
What are you using?
The Rar detection uses that exception then catches it currently so that's expected as an internal exception.
@PaulMcGuinness commented on GitHub (Mar 5, 2021):
It's a TAR backup from a Cisco CUCM PABX.... Unfortunately I can't put it here as it contains customer data :-(
If I use an alternative library for this file, it works fine.
@adamhathcock commented on GitHub (Mar 5, 2021):
I meant, what is the code?
You can use TarReader.Open or TarArchive.Open directly if you don't like the autodetection
@PaulMcGuinness commented on GitHub (Mar 5, 2021):
@adamhathcock commented on GitHub (Mar 5, 2021):
You can just change
ReaderFactorytoTarReaderand it's fine.Might want to be careful to dispose more stuff there. You also double check you need to buffer in memory as you can just stream the contents of entries directly to whatever.
@PaulMcGuinness commented on GitHub (Mar 5, 2021):
Many thanks