fileformat ~main

Tool for recognizing file formats


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

"fileformat" is free software.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

fileformat

fileformat is a tool for detecting and identifying file formats.

Official repositories:

The MIME system on Linux is not reliable enough — it fails to recognize formats such as TS (stream media container), DAV (CCTV video recording), several Microsoft-specific formats, some MATLAB formats, go.mod (Go module descriptor), PKT (Cisco Packet Tracer format), etc. Therefore, the "amalthea.fileformats" module was developed in the Amalthea library, which is used in this utility.

All formats are stored in /etc/amalthea-$DC/fileformats.json (where $DC is the D compiler being used).

Ready-made packages

See: Download Page of OS-18

The page contains installation instructions for several packages, including fileformat.

Build from source

Preparing

Before building, you need to install a compiler for D (this project supports compilers dmd, gdc and ldc2)

This project can be built with either dynamic or static linking against the Amalthea library. Therefore, if you want to build this project from source, you must first build and install Amalthea, then return to these instructions.

Compilation and installation

To create the executable file:

$ make

You can also specify a compiler:

$ make DC=gdc

Installation (by default, main directory is /usr/local/):

# make install

After installation, the program is ready to use.

The Makefile defines the following variables:

  • DESTDIR — specifies the root directory for installing (empty by default);
  • PREFIX — specifies the base directory, such as usr/local or usr.

The installation directory is defined as $(DESTDIR)/$(PREFIX) in the Makefile.

You can install the program files in any directory. For example, to install into $HOME/.local:

$ make install DESTDIR=$HOME PREFIX=.local

To uninstall:

# make uninstall

If installed to a non-default location, use the same paths when uninstalling:

$ make uninstall DESTDIR=$HOME PREFIX=.local

Usage

fileformat <file> ... [-m | --mime] [--formats <directory>]
    Displays format name, description and type
    (Audio, Video, Archives, etc.) for each specified file.

    With the '-m' or '--mime' option, the program also shows
    the MIME type and its description.

    Format descriptions are contained in a special JSON file,
    whose path is determined by your Amalthea library installation.
    If the library was compiled with the gdc compiler, the path is:
    /etc/amalthea-gdc/fileformats.json

    The '--formats' option allows you to specify a directory
    containing JSON files that describe additional file formats.

    Example:
        $ fileformat image.jpg -m
        Displays information about the file format
        and its MIME type for 'image.jpg'

Feedback

Questions, suggestions, comments, or bug reports:

[email protected]

You can also use the repository issue tracker.

Authors:
  • Eugene 'Vindex' Stulin
Dependencies:
amalthea
Versions:
0.4.6 2026-Jul-22
0.4.5 2025-Dec-21
0.4.4 2025-Oct-23
0.4.3 2025-Apr-23
0.4.2 2024-Jul-18
Show all 12 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 38 downloads total

Score:
0.0
Short URL:
fileformat.dub.pm