http://www.perlmonks.org?node_id=359382


in reply to Re: Re: first "project"
in thread first "project"

"I don't work on it much, but it does work - although VERY slowly! If you can see any reason why it runs slow for me, let me know and I'll change it."

Ok I see you are running a perl module interface to clamav

use Mail::ClamAV qw/:all/;
I'm talking about running the clamscan program itself directly:
my $results = `clamscan $dir`;
or something using Tk::Fileevent like:
my $dir = "/var/spool/mail"; my $program = "/usr/local/bin/clamscan $dir"; open(SCAN, "$program 2>&1 |") or die "Can't open: $!"; $mw->fileevent(\*SCAN, 'readable', [\&fill_text_widget,$t]); MainLoop; sub fill_text_widget { my($widget) = @_; $_ = <SCAN>; $widget->insert('end', $_); $widget->yview('end'); }

Its almost always faster to run properly designed c programs when doing alot of file access and reading, so let clamscan do it.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^4: first "project"
by phenom (Chaplain) on Jun 11, 2004 at 02:03 UTC
    Ok, I rewrote the clamscan version with your suggestion (see this). But it's still a little sluggish compared to the File::Scan version.

    I'd really like to switch to just doing the clamscan version, as it detects many more viruses.

    I'll try the Tk::Fileevent attempt soon. Thanks!