-
Notifications
You must be signed in to change notification settings - Fork 27
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
Option to disable "raw" libarchive format #77
Comments
I didn't understand the use case you're trying to cover. If you want to check if the file is an archive or not it might be done using the file header for example. |
The use-case is a tool which performs file analysis and searches on a directory, including support for traversing archive files found within said directory. The question I'm trying to answer, as such, is "is libarchive capable of parsing a given, otherwise unknown, file as an archive?". Checking if a file is a valid archive with another tool is not sufficient, as (a) libarchive's scope of supported can depend on version and compile flags, (b) I would need to repeat myself by writing checks for every format currently supported by libarchive regardless. |
Generally speaking, if not supported, it will report an error. Isn't this enough? |
It will not. The "raw" format enables reading any file, even one which is not an archive, as an archive containing a single file, "data". Quoting from the libarchive documentation, emphasis mine:
|
Ok so what is your proposal? Please open a draft PR proposing what you'd like to be done so we can understand it better. |
Have you thought about the API you'd like to have? |
Sorry. I've started looking into it, but I've been working on other projects since, and I have no ETA to coming back to this :( |
I'd like to use compress-tools-rs in a situation where I want to treat archive and non-archive files differently; enabling the "raw" format makes it effectively impossible to distinguish archives from non-archives and/or corrupt archives.
The text was updated successfully, but these errors were encountered: