View Issue Details

IDProjectCategoryView StatusLast Update
0000653fileGeneralpublic2025-05-28 16:46
Reporteronnimonni Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product Version5.41 
Summary0000653: Can't peak into zip archive which has JSON files inside
DescriptionHey,

I checked all arguments for 'file' and saw useful '-z' flag:

$ file --help
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.

      --help display this help and exit
  -v, --version output version information and exit
  -m, --magic-file LIST use LIST as a colon-separated list of magic
                               number files
  -M LIST use LIST as a colon-separated list of magic
                               number files in place of default
 LIST use LIST as a colon-separated list of magic
                               number files in place of default
  -z, --uncompress try to look inside compressed files

I tried couple of different zip files which have json files inside of them. I can peak into them with MacOS finder or with `atool` but not with `file`.
Steps To ReproduceFirst visit https://api.zone.eu/v2 and click Download.

$ cd ~/Downloads
$ zip swagger.zip swagger.json
$ file swagger.zip
swagger.zip: Zip archive data, at least v2.0 to extract, compression method=deflate
$ file -z swagger.zip
swagger.zip: ERROR:[gzip: Unknown compression format] (Zip archive data, at least v2.0 to extract, compression method=deflate)
Additional InformationIt works well with gzipped archives and I thought that maybe it should for zip files too? Anyway thanks for maintaining this magnificent piece of software : ) !
TagsNo tags attached.

Activities

christos

2025-05-28 16:46

manager   ~0004240

Zip is a container archive that can contain multiple files. To work properly file would need to iterate through each file in the archive and examine it. While it would be nice to be able to do this, it opens the pandora's box: should we do this for tar files? random archives? etc.

Issue History

Date Modified Username Field Change
2025-05-08 20:10 onnimonni New Issue
2025-05-28 16:44 christos Assigned To => christos
2025-05-28 16:44 christos Status new => assigned
2025-05-28 16:46 christos Status assigned => feedback
2025-05-28 16:46 christos Note Added: 0004240