APM: processing lots of files?
Dennis Moore
rainking at feeding.frenzy.com
Fri Apr 23 15:05:03 CDT 2004
On Fri, Apr 23, 2004 at 12:47:53PM -0500, Sam Foster wrote:
> So I'm still working on this one.
> Just now I ran a script that crawled a directory structure to identify
> "empty" directory (directories that had only some boiler plate
> properties files and no actual data) that produced a list of around 5
> thousand matches.
> It took a while.
> Now I've taken that list, split it into 4 and given each piece to a
> rmtree script. I did this by cutting and pasting the lines into new text
> files, and creating new command prompts to start each instance of my
> script. This gives me 4 seperate processes running in parallel each
> tackling a part of the task.
>
> What I'd like is a wrapper that does this for me. I give it the script
> filename, the filelist and perhaps the number of clones to create, and
> have it basically do the above for me.
>
> But system calls wait for the process to finish before continuing so I'm
> not sure how to achieve this. I've looked at some forking code but I'll
> admit to being a little daunted.
>
> I also looked at Parallel::Jobs on cpan and took a stab at use it
> without success - the child processes weren't terminating and nor did
> they seem to be running in parallel.
>
> any pointers?
http://hacks.dlux.hu/Parallel-ForkManager/
--
<BLINK> ;for (74,1970500640,1634627444,1751478816,1348825708,543711587,
1801810465){for($x=1<<1^1;$x>=1>>1;$x--) {$q=hex ff,$r=oct($x=~s,\d,$&*
10,e,$x),$x/=1/.1,$q<<=$r,$s.=chr (($_&$q)>>$r),$t++}}while($= ||= !$|)
{$o=$o?$?:$/;$|=1;print $o?$s:$"x$t if$;;print"\b"x$t;sleep 1} </BLINK>
More information about the Austin
mailing list