magic 0.12.0

libmagic bindings
Documentation

rust-magic Build Status

libmagic bindings for Rust.

Usage

Create a new Cargo project (or edit your existing one):

$ cargo new --bin magic-usage && cd magic-usage/
$ $EDITOR Cargo.toml

Add a dependency to your Cargo.toml (see Cargo doc):

[dependencies]
magic = "0.*"

Then use the magic crate according to its documentation.

Requirements

Needs rustc 1.6 stable or later. Create an issue if it does not work on current stable.

License

This project is licensed under the MIT license (see LICENSE).

The magic-sys crate being used is licensed under the MIT license as well (see LICENSE).

The file/libmagic project is licensed under a modified BSD license (see COPYING). This crate contains partial test-data from its magic databases (rust-magic/data/tests/db-images-png is from file/magic/Magdir/images, rust-magic/data/tests/db-python is from file/magic/Magdir/python).