[Gambas-user] gambas noob needs assistance(2 questions)

Laurent Carlier lordheavy at ...512...
Thu Sep 2 23:02:42 CEST 2004


Le jeudi 2 Septembre 2004 22:33, Chas.Bigham a écrit :

> code
> ---------------------------------------------------------------------------
>
> PUBLIC SUB btnScan_Click()
>     EXEC [ "bdc", $Option0, $Option1, $Option2, $PathToBeScanned ] FOR READ
> END
> --------------------------------------------------------------------------
>

You should define a process object (see in doc gb.process), you will find in 
the example basic/console how to implement it.
( ex : EXEC [ "ls" ] FOR READ AS myProcess )

> how can i get the process id of bdc and return it to my front-end so
> that i can enable a Stop Scan button, killing the bdc command and
> stopping it from scanning....
>

Use the Id property of the process object ( ex : print myProcess.Id )
Use the kill property to kill the process ( ex : myProcess.kill )

>
> second question: in relation to the above EXEC statement, i would like
> to implement a Quarantine Viewer in my front-end, using a column view to
> display the contents of bdc's quarantine folders. bdc returns info that
> reads somethinmg like:
> "/home/shared/setup.exe Infected VirusName.W32.AA"
> what i want is to be able to parse that string into a columnview with 3
> headings: File, Status, and Infected With and the relevant bits given by
> bdc returned to each corresponding column. (ie: File:
> /home/shared/Setup.exe, Status: Infected, Infected With: VirusName.W32.AA)
>

As process inherit from Stream, you can grab the output (in docs too) and you 
should split the line with Split keyword.

> i've read through the mailing list and while i've found answers to some
> of other problems i was having, i've been unable to find a suitable
> answer for both of these problems. any help that anyone can offer is
> greatly and genuinely appreciated
>
> Thanks for your time and help
> Chas. Bigham
>

Regards,

-- 

Laurent Carlier




More information about the User mailing list