Clamex v0.2.2 Clamex.Scanner.Clamscan View Source

Scanner implementation for clamscan command-line utility.

Link to this section Summary

Functions

Perform file scan using clamscan command-line utility.

Link to this section Functions

Specs

scan(path :: Path.t()) :: :ok | {:error, atom()} | {:error, String.t()}

Perform file scan using clamscan command-line utility.

Examples

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

iex> Clamex.Scanner.Clamscan.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
  • any other error reported by the scanner will be returned as is (as String)