Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Re: Re: first "project"

by zentara (Archbishop)
on Jun 02, 2004 at 12:40 UTC ( #359382=note: print w/replies, xml ) Need Help??

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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://359382]
[Eily]: as long as your CUFP is ready for the world it should be fine ;-)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2018-05-28 09:30 GMT
Find Nodes?
    Voting Booth?