Using the new OSProcess still no Stdout string
I once reported a bug for OSProcess on MacOS https://pharo.fogbugz.com/f/cases/16944/OSProcess-stdout-is-not-returned-bac... Still experience the same problem, is this suppose to be fixed with new OSProcess ?
You want to use waitForCommand: instead of command:, like Transcript show: (PipeableOSProcess waitForCommand: 'whoami') output command: doesn't wait for output and is useful only for commands that don't return anything. It's kind of useless for anything that returns values. I haven't tried this on Pharo 5, I've gotten it to work on Pharo 4. On Friday, March 4, 2016, Dimitris Chloupis <kilon.alios@gmail.com> wrote:
I once reported a bug for OSProcess on MacOS
https://pharo.fogbugz.com/f/cases/16944/OSProcess-stdout-is-not-returned-bac...
Still experience the same problem, is this suppose to be fixed with new OSProcess ?
I just loaded the latest image and vm using curl get.pharo.org/alpha+vmLatest | bash and OSProcess and CommandShell seem to work OK. On Friday, March 4, 2016, john pfersich <jpfersich@gmail.com> wrote:
You want to use waitForCommand: instead of command:, like
Transcript show: (PipeableOSProcess waitForCommand: 'whoami') output
command: doesn't wait for output and is useful only for commands that don't return anything. It's kind of useless for anything that returns values. I haven't tried this on Pharo 5, I've gotten it to work on Pharo 4.
On Friday, March 4, 2016, Dimitris Chloupis <kilon.alios@gmail.com <javascript:_e(%7B%7D,'cvml','kilon.alios@gmail.com');>> wrote:
I once reported a bug for OSProcess on MacOS
https://pharo.fogbugz.com/f/cases/16944/OSProcess-stdout-is-not-returned-bac...
Still experience the same problem, is this suppose to be fixed with new OSProcess ?
Well, I have to take back the comment on command:. I have this code snippet that gets output from a command: | p d | p := (PipeableOSProcess command: 'netstat -a | grep LISTEN | grep 27017'). p keepInitialStdOutOpen: true. d := Delay forMilliseconds: 500. d wait. [Transcript show: (p next: 300); flush. p isComplete] whileFalse: [d wait]. Transcript show: 'Error output'; cr; show: (p errorUpToEnd). p closeOutput. The netstat takes forever on a Mac, which is why the delays are so long. The On Friday, March 4, 2016, john pfersich <jpfersich@gmail.com> wrote:
You want to use waitForCommand: instead of command:, like
Transcript show: (PipeableOSProcess waitForCommand: 'whoami') output
command: doesn't wait for output and is useful only for commands that don't return anything. It's kind of useless for anything that returns values. I haven't tried this on Pharo 5, I've gotten it to work on Pharo 4.
On Friday, March 4, 2016, Dimitris Chloupis <kilon.alios@gmail.com <javascript:_e(%7B%7D,'cvml','kilon.alios@gmail.com');>> wrote:
I once reported a bug for OSProcess on MacOS
https://pharo.fogbugz.com/f/cases/16944/OSProcess-stdout-is-not-returned-bac...
Still experience the same problem, is this suppose to be fixed with new OSProcess ?
thanks for freezing my image !!! Argggg !!!! :D On Sat, Mar 5, 2016 at 10:44 AM john pfersich <jpfersich@gmail.com> wrote:
Well, I have to take back the comment on command:. I have this code snippet that gets output from a command:
| p d | p := (PipeableOSProcess command: 'netstat -a | grep LISTEN | grep 27017'). p keepInitialStdOutOpen: true. d := Delay forMilliseconds: 500. d wait. [Transcript show: (p next: 300); flush. p isComplete] whileFalse: [d wait]. Transcript show: 'Error output'; cr; show: (p errorUpToEnd). p closeOutput.
The netstat takes forever on a Mac, which is why the delays are so long. The
On Friday, March 4, 2016, john pfersich <jpfersich@gmail.com> wrote:
You want to use waitForCommand: instead of command:, like
Transcript show: (PipeableOSProcess waitForCommand: 'whoami') output
command: doesn't wait for output and is useful only for commands that don't return anything. It's kind of useless for anything that returns values. I haven't tried this on Pharo 5, I've gotten it to work on Pharo 4.
On Friday, March 4, 2016, Dimitris Chloupis <kilon.alios@gmail.com> wrote:
I once reported a bug for OSProcess on MacOS
https://pharo.fogbugz.com/f/cases/16944/OSProcess-stdout-is-not-returned-bac...
Still experience the same problem, is this suppose to be fixed with new OSProcess ?
On Sat, Mar 05, 2016 at 02:19:10PM +0000, Dimitris Chloupis wrote:
thanks for freezing my image !!! Argggg !!!! :D
On Sat, Mar 5, 2016 at 10:44 AM john pfersich <jpfersich@gmail.com> wrote:
p := (PipeableOSProcess command: 'netstat -a | grep LISTEN | grep 27017').
netstat -an Option n avoids DNS lookup which is the likely cause of the delay. Pierce
participants (3)
-
Dimitris Chloupis -
john pfersich -
Pierce Ng