Project

General

Profile

Actions

Bug #588

open

file(1) should be able to look inside compressed files

Added by Alexander Eremin over 12 years ago. Updated about 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2010-12-30
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

Need implement "-z , -uncompress" keys for file(1).


Related issues

Related to illumos gate - Bug #2990: file(1) should have a -s flag to process special filesNew2012-07-12

Actions
Actions #1

Updated by Roland Mainz over 12 years ago

Which compression formats does "-z" recognize ?

Actions #2

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 */

Actions #3

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?

Actions #4

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.

Actions #5

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.

If we pick a different version I'd like to see some stuff included:
  • 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
Actions #6

Updated by Yuri Pankov over 12 years ago

Roland Mainz wrote:

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.

If we pick a different version I'd like to see some stuff included:
  • 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.

Actions #7

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.

Actions

Also available in: Atom PDF