scan_file

Function scan_file 

Source
pub async fn scan_file<P: AsRef<Path>, T: TransportProtocol>(
    file_path: P,
    connection: T,
    chunk_size: Option<usize>,
) -> IoResult
Expand description

Scans a file for viruses

This function reads data from a file located at the specified file_path and streams it to a ClamAV server for scanning.

§Arguments

  • file_path: The path to the file to be scanned
  • connection: The connection type to use - either TCP or a Unix socket connection
  • chunk_size: An optional chunk size for reading data. If None, a default chunk size is used

§Returns

An IoResult containing the server’s response as a vector of bytes