Final implement of clamav gem

This commit is contained in:
Xavier J 2016-04-15 15:32:15 +02:00
parent 4099efd326
commit 900b377ae2
5 changed files with 37 additions and 16 deletions

View file

@ -1,9 +1,12 @@
class ClamavService
def self.safe_io_data? path_file
client = ClamAV::Client.new
def self.safe_file? path_file
FileUtils.chmod 0666, path_file
client = ClamAV::Client.new
response = client.execute(ClamAV::Commands::ScanCommand.new(path_file))
puts response
return false if response.first.class == ClamAV::VirusResponse
true
end
end