# Clamex


Clamex is a thin, error-friendly wrapper for [ClamAV]( written in elixir.

## Installation

The package can be installed by adding `clamex` to your list of dependencies in `mix.exs`:

def deps do
    {:clamex, "~> 0.1.0"}

## Requirements

ClamAV is not included in this package and must be installed separately. Please consult [ClamAV's official documentation]( on how to install it on your system.

## Configuration

It is recommended to have the ClamAV daemon (`clamd`) running in background and use `clamdscan` as a scanner, instead of `clamscan` which takes few seconds to initialize.

The following is the package's default configuration.

config :clamex, executable_path: "clamdscan"

If the `clamdscan` is not available in `$PATH` pull path to it can be specified as `executable_path`.

## Usage

Check if file is infected:

iex> Clamex.virus?("test/files/virus.txt")

iex> Clamex.virus?("test/files/safe.txt")

Check if file is safe:



Note that if there scanner encounters any errors, both `virus?` and `safe?` functions will quietly ignore them and return `false`. If you need to handle errors explicitly use the `scan` function directly.

Perform the file scan:

iex> Clamex.scan("test/files/virus.txt")
{:error, :virus_found}

iex> Clamex.scan("test/files/safe.txt")

Please check the documentation for other error reasons that may be returned by `scan`.

## Documentation

Full documentation can be found at [](

## License

Copyright 2018 Michał Szajbe

Licensed under the MIT license. For more information see the [LICENSE.txt](LICENSE.txt) file.