Skip to content

Failure to extract from deflate .Z file #114

@raymondben

Description

@raymondben

These two .Z files (sea ice concentration data, renamed with .txt extension to allow upload here) should decompress to about 840k each. 20231030.nc.Z silently seems to not decompress at all:

> ff <- archive::file_read("20231030.nc.Z", mode = "rb")
> foo <- readBin(ff, what = "raw", n = 1e7)
> length(foo)
[1] 98598
> file.size("20231030.nc.Z")
[1] 98598

whereas 20231026.nc.Z decompresses fine. They are both from the same provider but I notice that the compression method may have changed:

$ uncompress -vl 20231030.nc.Z
method  crc     date  time           compressed        uncompressed  ratio uncompressed_name
defla ffffffffffffffff May  9 09:09               98598                  -1   0.0% 20231030.nc

$ uncompress -vl 20231026.nc.Z
method  crc     date  time           compressed        uncompressed  ratio uncompressed_name
compr ffffffffffffffff May  9 09:09               95167                  -1   0.0% 20231026.nc

(i.e. the provider has switched from compress to deflate?)

Is there any way to read the deflate file? I tried specifying file_read(..., filter = "something") without success.

  • thanks.

20231030.nc.Z.txt
20231026.nc.Z.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions