Re: [Gambas-user] help with EXEC usage

2011-03-26 Thread Bill-Lancaster
Thank you, IF hProc.State = Process.Running THEN SHELL ("pidof get_iplayer") TO pid1 SHELL ("pidof mplayer") TO pid2 DEBUG pid1;; pid2 SHELL "kill " & pid1 & " " & pid2 hProc.Kill() ENDIF To me this is nice code - it works! Bill -- View this message in contex

Re: [Gambas-user] help with EXEC usage

2011-03-26 Thread Benoît Minisini
> This seems to work... but it is not very nice code, as it doesn't make > distinction of what instance of "get_iplayer" or "mplayer > you are dealing with... > Also it leaves some trash (get_iplayer doesn't take care of it's trashes!) > to ~/.get_iplayer. > Maybe get_iplayer should be killed with

Re: [Gambas-user] help with EXEC usage

2011-03-25 Thread Jussi Lahtinen
This seems to work... but it is not very nice code, as it doesn't make distinction of what instance of "get_iplayer" or "mplayer you are dealing with... Also it leaves some trash (get_iplayer doesn't take care of it's trashes!) to ~/.get_iplayer. Maybe get_iplayer should be killed with some other

Re: [Gambas-user] help with EXEC usage

2011-03-25 Thread Benoît Minisini
> I think this is what Benoit means; > > PUBLIC hProc AS Process > > PUBLIC SUB btnPlay_Click() > hProc = SHELL ("get_iplayer --stream 13280 | mplayer -cache 3072 -") > FOR WRITE > END > > PUBLIC SUB btnStop_Click() > > IF hProc.State = Process.Running THEN > DEBUG hProc.Handle >

Re: [Gambas-user] help with EXEC usage

2011-03-25 Thread Jussi Lahtinen
I think this is what Benoit means; PUBLIC hProc AS Process PUBLIC SUB btnPlay_Click() hProc = SHELL ("get_iplayer --stream 13280 | mplayer -cache 3072 -") FOR WRITE END PUBLIC SUB btnStop_Click() IF hProc.State = Process.Running THEN DEBUG hProc.Handle SHELL "kill -s HUP " & CSt

Re: [Gambas-user] help with EXEC usage

2011-03-25 Thread Bill-Lancaster
Benoît, what do you mean by "run shell again" ? I tried:- IF hProc THEN hProc.Kill SHELL "" ENDIF with no effect Bill -- View this message in context: http://old.nabble.com/help-with-EXEC-usage-tp31208112p31235898.html Sent from the gambas-user mailing list archiv

Re: [Gambas-user] help with EXEC usage

2011-03-24 Thread Benoît Minisini
> > Bit short of time... but quickly looking at this. > > I'm not sure but I think this problem has something to do with fact that > > you are starting two process with shell command. > > And I'm not sure how Gambas2 handles these... does it try to kill the > > shell itself, or process started with

Re: [Gambas-user] help with EXEC usage

2011-03-24 Thread Benoît Minisini
> Bit short of time... but quickly looking at this. > I'm not sure but I think this problem has something to do with fact that > you are starting two process with shell command. > And I'm not sure how Gambas2 handles these... does it try to kill the shell > itself, or process started with command s

Re: [Gambas-user] help with EXEC usage

2011-03-24 Thread Jussi Lahtinen
Bit short of time... but quickly looking at this. I'm not sure but I think this problem has something to do with fact that you are starting two process with shell command. And I'm not sure how Gambas2 handles these... does it try to kill the shell itself, or process started with command shell. So,

Re: [Gambas-user] help with EXEC usage

2011-03-23 Thread Bill-Lancaster
Sorry - I'll try again. Its so simple, hardly worth making a project. I'm using get_iplayer in a Gambas project to download past BBC radio programmes. It's working fine. To listen to the programme, this is the code - get_iplayer --stream 13142 | mplayer -cache 3072 -, where 13142 is the progra

Re: [Gambas-user] help with EXEC usage

2011-03-23 Thread Jussi Lahtinen
Can't see attachment..? Jussi On Wed, Mar 23, 2011 at 17:51, Bill-Lancaster wrote: > > Jussi - little project attached > -- > View this message in context: > http://old.nabble.com/help-with-EXEC-usage-tp31208112p31221079.html > Sent from the gambas-user mailing list archive at Nabble.com. > > >

Re: [Gambas-user] help with EXEC usage

2011-03-23 Thread Bill-Lancaster
Jussi - little project attached -- View this message in context: http://old.nabble.com/help-with-EXEC-usage-tp31208112p31221079.html Sent from the gambas-user mailing list archive at Nabble.com. -- Enable your software

Re: [Gambas-user] help with EXEC usage

2011-03-23 Thread Jussi Lahtinen
Hmmm... no wait... you are working with Gambas 2. I don't know what is wrong. Please send little project to demonstrate the problem. Jussi On Wed, Mar 23, 2011 at 17:12, Jussi Lahtinen wrote: > Name is missing... > $hProcess = SHELL ("get_iplayer --stream 13280 | mplayer -cache 3072-") FOR > WR

Re: [Gambas-user] help with EXEC usage

2011-03-23 Thread Jussi Lahtinen
Name is missing... $hProcess = SHELL ("get_iplayer --stream 13280 | mplayer -cache 3072-") FOR WRITE *As "Process"* Jussi On Wed, Mar 23, 2011 at 10:37, Bill-Lancaster wrote: > > Jussi, thanks for the advice. > > I forgot to mention that it worked also with SHELL but I had no control > over >

Re: [Gambas-user] help with EXEC usage

2011-03-23 Thread Bill-Lancaster
Jussi, thanks for the advice. I forgot to mention that it worked also with SHELL but I had no control over the process. $hProcess = SHELL ("get_iplayer --stream 13280 | mplayer -cache 3072 -") FOR WRITE Neither PRINT #$hProcess, "q"; nor IF $hProcess THEN $hProcess.Kill nor

Re: [Gambas-user] help with EXEC usage

2011-03-22 Thread Jussi Lahtinen
I think you need to use shell if you need pipes. http://gambasdoc.org/help/doc/shellexec Jussi On Tue, Mar 22, 2011 at 11:07, Bill-Lancaster wrote: > > This works OK in terminal:- > > get_iplayer --stream 12735 | mplayer -cache 3072 - > > But I can't get it to run in EXEC, e.g > > $hPro

[Gambas-user] help with EXEC usage

2011-03-22 Thread Bill-Lancaster
This works OK in terminal:- get_iplayer --stream 12735 | mplayer -cache 3072 - But I can't get it to run in EXEC, e.g $hProcess = EXEC ["get_iplayer", "--stream", "12735", "|", "mplayer", "-cache", "3072 -"] and all kind of other permuations. Any help would be appreciated Bill Lan