logo       

forking an external process: msg#00020

gnome.gtk+.perl

Subject: forking an external process

hi

I want my gui to be accesable even when an external process is doing
some work.
My program does the following:
initialise the GUI
exec of a wget process
wait for it to return
do somthing to the return which will update the GUI (add rows to a
clist)

as it is now it hangs while the wget process is running. I have tried to
fork it but it doesnt work:
sub getnews{
$clist->clear();
if (fork() == 0) {
exec("wget http://www.slashdot.org/slashdot.rdf -nv -q -O \
slashdot.rdf");
exit(0);
}
parse_xml();
}

what have I done wrong? the parse_xml part is only to be runned when the
exec has returned somthing

--
Kim Schulz - Freelance Development | Never buy from a rich
www.schulz.dk - En nørds bekendelser | salesman. -- Goldenstern
www.linuxia.dk - hverdagens små hacks |


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise