Trebejo.Compress.Format (Trebejo v2.0.0)

Copy Markdown View Source

Detects archive/compression format from file extensions and lists archive contents.

Summary

Functions

Detects the archive or compression type from a file extension.

Lists the contents of an archive. Auto-detects format.

Types

archive_type()

@type archive_type() ::
  :zip
  | :tar
  | :tar_gz
  | :tar_bz2
  | :tar_xz
  | :tar_zst
  | :gz
  | :zst
  | :xz
  | :bz2
  | :seven_z
  | :rar
  | :unknown

Functions

detect_type(path)

@spec detect_type(binary()) :: archive_type()

Detects the archive or compression type from a file extension.

list(file)

@spec list(binary()) :: {:ok, [binary()]} | {:error, binary()}

Lists the contents of an archive. Auto-detects format.