Chapter 3. The kavclient command-line tool

The kavclient command-line tool is provided with the libkavclient library mostly as an example of how to use the library functions. However, it may well be used as a command-line virus checker. This command is used as follows:

kavclient [ -o | --options options] [ -s | --shmem ] filename ...

The -o or --options option allows to specify kavscanner command-line options. Refer to kavscanner documentation for description of available options. You need to omit the leading - character and separate options with the | character. The argument to this option is passed to kav_check_files function as its options parameter.

The -s or --shmem option directs kavclient to pass the file to be checked to KAVDaemon via shared memory. The purpose of this option is mostly to demonstrate how to check memory segments for viruses with libkavclient. Other than that, it makes little sense to pass files via memory, since KAVDaemon can check files directly on disk. Note that you cannot use the -o option or specify more than one file to check when using the -s option.

The non-option arguments to kavclient are treated as file or directory names to check.

The kavclient's output shows the check status (as returned by kav_result_get_status) and KAVDaemon's textual report (as returned by kav_result_get_report).

An example output from kavclient may look like this:

/tmp % kavclient textfile.txt eicar.com
Check result: 4
Report: /tmp/textfile.txt       ok.
/tmp/eicar.com  infected: EICAR-Test-File