clamxir v0.1.8 Clamxir

Clamxir is a wrapper for clamav. It requires to have installed clamav in order to work. As a suggestion, run the config with the daemonize flag as it will use the daemon instance of clamav. Also if you run on permission issues, adding stream flag with help you with it.

Link to this section Summary

Functions

Returns a tuple with the result of the function

Returns true if the check flag of config isn’t set. Otherwise will return a boolean if the scanner has been found

Return boolean with the result if succeded. Otherwise, a tuple with {:error, message}

Link to this section Functions

Link to this function file_exists?(path)

Returns a tuple with the result of the function.

Examples

iex> Clamxir.file_exists?("README.md")
{:ok, "README.md"}

iex> Clamxir.file_exists?("NO_FILE.md")
{:error, "NO_FILE.md not found."}
Link to this function safe?(clamxir_config, path)

The oppossite of virus?/2.

Examples

iex> Clamxir.safe?(%Clamxir{stream: true, daemonize: true}, "README.md")
true

iex> Clamxir.safe?(%Clamxir{stream: true, daemonize: true}, "NOT_FOUND.md")
{:error, "NOT_FOUND.md not found."}
Link to this function scanner_exists?(clamxir_config)

Returns true if the check flag of config isn’t set. Otherwise will return a boolean if the scanner has been found.

Examples

iex> Clamxir.scanner_exists?(%Clamxir{})
true

iex> Clamxir.scanner_exists?(%Clamxir{check: true})
true
Link to this function virus?(clamxir_config, path)

Return boolean with the result if succeded. Otherwise, a tuple with {:error, message}

Examples

iex> Clamxir.virus?(%Clamxir{}, "README.md")
false

iex> Clamxir.virus?(%Clamxir{stream: true, daemonize: true}, "README.md")
false

iex> Clamxir.virus?(%Clamxir{stream: true, daemonize: true}, "NOT_FOUND.md")
{:error, "NOT_FOUND.md not found."}