Hi,
I am using Clamv as antivirus program to check for any virus infected files.
How do I execute the command for invoking the antivirus program and interpret the results.
System only indicates whether the command was executed successfully or not, however I need to get the results returned by Clamv.
The command to be executed for checking the files for virus
/usr/bin/clamdscan --disable-summary --mbox --stdout /var/tmp/filename
and the result returned by clamv is
/var/tmp/filename:Worm.Mydoom.M FOUND, if virus is found
if no virus is found the result returned is
/var/tmp/filename : ok
I have to put this result in a variable and then manipulate the string variable to get the name of the virus returned.
I don't want to redirect the stdoutput to a file as this will entail a lot of overhead (I have to process large amount of files at a time).
I know that we can put the results returned into a buffer and then copy that buffer into a variable, however I am very new to C++ programming so don't know exactly how to do this.
Would appreciate any help in this regard
Thanks,
Mohit