Bug #588
openfile(1) should be able to look inside compressed files
0%
Description
Need implement "-z , -uncompress" keys for file(1).
Related issues
Updated by Roland Mainz over 12 years ago
Which compression formats does "-z" recognize ?
Updated by Alexander Eremin over 12 years ago
from gnu version:
"gzip", "-cdq" /* compressed /
"uncompress", "-c" / compressed /
"gzip", "-cdq" / gzipped /
"gzip", "-cdq" / frozen /
"gzip", "-cdq" / SCO LZH /
"gzip", "-cdq" / packed /
"gzip", "-cdq" / pkzipped, /
"bzip2", "-cd" / bzip2-ed /
"lzip", "-cdq"
"xz", "-cd" / XZ Utils */
Updated by Yuri Pankov over 12 years ago
I'm not sure why you are referring to file from ftp://ftp.astron.com/pub/file/ as "gnu version", it seems to have 2-clause BSD license in its source files. Anyway, couldn't this version be used instead of what we currently have, as it's standard for Linux, *BSD, other systems?
Updated by Kartik Mistry over 12 years ago
Not exactly gnu. It is available in Linux, *BSD, ..
http://www.darwinsys.com/file/ is homepage for file.
Updated by Roland Mainz over 12 years ago
Question:
What do we want - do we want to enhance the existing /usr/bin/file+/usr/xpg4/bin/file or replace it with a new version ? The issue with picking a new version is that /etc/magic&co.'s file format will change in an incompatible way.
- Support for compressed files (as requested by this bug)
- POSIX behaviour by default (e.g. "POSIXLY_CORRECT" in GNU terms)
- Support for printing mime types
- Support for printing all matches and not only the first one
- Support for compiled /etc/magic to boost performance
Updated by Yuri Pankov over 12 years ago
Roland Mainz wrote:
Question:
If we pick a different version I'd like to see some stuff included:
What do we want - do we want to enhance the existing /usr/bin/file+/usr/xpg4/bin/file or replace it with a new version ? The issue with picking a new version is that /etc/magic&co.'s file format will change in an incompatible way.
- Support for compressed files (as requested by this bug)
- POSIX behaviour by default (e.g. "POSIXLY_CORRECT" in GNU terms)
- Support for printing mime types
- Support for printing all matches and not only the first one
- Support for compiled /etc/magic to boost performance
I've created webrev for file-5.05 from http://www.darwinsys.com/file/, having all requested features - http://darklight.org.ru/webrev/588-file/. Incompatible magic files don't seem to be a downside given all the data distributed with this version (and local changes can be easily added, if needed). I've added all source files to exceptions_lists/* not modifying original source to make future imports of newer version easier - not sure if this is correct. Another problem is manpage, not sure how it should be handled as well. I would like to hear any comments on import/Makefile/etc. Thanks.
Updated by Josef Sipek about 9 years ago
- Difficulty set to Medium
- Tags set to needs-triage
You are correct. I incorrectly labeled it as GNU file.
I wonder if it would make sense to just drop file from illumos-gate and let distros chose what they want. The file Linux and BSDs use, or dig up our antiquated source and compile & package it themselves.