Clamex v0.2.1 Clamex.Scanner.Clamdscan View Source

Scanner implementation for clamdscan command-line utility.

Link to this section Summary

Functions

Perform file scan using clamdscan command-line utility

Link to this section Functions

Link to this function scan(path) View Source
scan(path :: Path.t) ::
  :ok |
  {:error, atom} |
  {:error, String.t}

Perform file scan using clamdscan command-line utility.

Examples

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

iex> Clamex.Scanner.Clamdscan.scan("test/files/safe.txt")
:ok

Error reasons

  • :virus_found - file is infected
  • :cannot_access_file - file specified as path cannot be accessed
  • :scanner_not_available - scanner is not available at executable_path
  • :cannot_connect_to_clamd - ClamAV daemon is not running in background
  • any other error reported by the scanner will be returned as is (as String)