I want to write a test for an NB Mac system call example (Issue 13147). I can check the exit code easily, the output goes to stdout of the image. Can I capture it somehow? thx :) ----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
start pharo from the console? On 28.03.2014, at 12:57, Sean P. DeNigris <sean@clipperadams.com> wrote:
I want to write a test for an NB Mac system call example (Issue 13147). I can check the exit code easily, the output goes to stdout of the image. Can I capture it somehow? thx :)
----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Forget what I said⦠Just rambling⦠On 28.03.2014, at 13:48, Max Leske <maxleske@gmail.com> wrote:
start pharo from the console?
On 28.03.2014, at 12:57, Sean P. DeNigris <sean@clipperadams.com> wrote:
I want to write a test for an NB Mac system call example (Issue 13147). I can check the exit code easily, the output goes to stdout of the image. Can I capture it somehow? thx :)
----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Max Leske wrote
Forget what I said⦠Just ramblingâ¦
Ha ha, I was doing the confused-puppy-head-tilt (see http://da0cb6511396a92928c7-488d28a6573db6ac4a247063b638fcb9.r77.cf2.rackcdn...) ----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320p4751409.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
On 28.03.2014, at 15:55, Sean P. DeNigris <sean@clipperadams.com> wrote:
Max Leske wrote
Forget what I said⦠Just ramblingâ¦
Ha ha, I was doing the confused-puppy-head-tilt (see http://da0cb6511396a92928c7-488d28a6573db6ac4a247063b638fcb9.r77.cf2.rackcdn...)
:p
----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320p4751409.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Hi I managed to do that in Windows using ProcessWrapper new useStdout; startWithShellCommand: aCommand ; upToEnd. where aCommand is something like: "someApp.exe -p params moreParams > G:\other\place\stdou.log" This is what Hernan Morales offered
Gofer it url: 'http://www.smalltalkhub.com/mc/hernan/ProcessWrapper/main'; package: 'ProcessWrapper-Core'; package: 'ProcessWrapper-Plugin'; package: 'ProcessWrapper-Tests'; load.
ProcessWrapper new useStdout; startWithShellCommand: 'dir | sort'; upToEnd
Best Emilio
-----Mensaje original----- De: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] En nombre de Sean P. DeNigris Enviado el: Viernes, 28 de Marzo de 2014 08:58 Para: pharo-dev@lists.pharo.org Asunto: [Pharo-dev] Capturing stdout
I want to write a test for an NB Mac system call example (Issue 13147). I can check the exit code easily, the output goes to stdout of the image. Can I capture it somehow? thx :)
----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout- tp4751320.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Emilio Oca-3 wrote
I managed to do that in Windows using... ProcessWrapper...
As it's for a core test, I need to find a way to do it without loading additional libraries. I could pipe the output to a tmp file if there's nothing... ----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320p4751521.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Maybe⦠Since Pharo now has a command line handler, you could redirect stdout to the vm process? Will probably not work while the image is running I guess. But maybe it will (see for example http://serverfault.com/questions/178457/can-i-send-some-text-to-the-stdin-of...) On 28.03.2014, at 21:56, Sean P. DeNigris <sean@clipperadams.com> wrote:
Emilio Oca-3 wrote
I managed to do that in Windows using... ProcessWrapper...
As it's for a core test, I need to find a way to do it without loading additional libraries. I could pipe the output to a tmp file if there's nothing...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320p4751521.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
On Windows, there is work to do on the VM platform sources to get the command line output to work properly. There are a set of MsgBox calls in there where one could use a nice little printf/puts. I've been looking at it but there is more than meets the eye there. Phil On Fri, Mar 28, 2014 at 10:23 PM, Max Leske <maxleske@gmail.com> wrote:
Maybe... Since Pharo now has a command line handler, you could redirect stdout to the vm process? Will probably not work while the image is running I guess. But maybe it will (see for example http://serverfault.com/questions/178457/can-i-send-some-text-to-the-stdin-of... )
On 28.03.2014, at 21:56, Sean P. DeNigris <sean@clipperadams.com> wrote:
Emilio Oca-3 wrote
I managed to do that in Windows using... ProcessWrapper...
As it's for a core test, I need to find a way to do it without loading additional libraries. I could pipe the output to a tmp file if there's nothing...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320p4751521.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
philippeback wrote
On Windows, there is work to do on the VM platform sources to get the command line output to work properly.
It would be great to have something like an announcer that one can register with to receive stdout ----- Cheers, Sean -- View this message in context: http://forum.world.st/Capturing-stdout-tp4751320p4751583.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (4)
-
Emilio Oca -
Max Leske -
phil@highoctane.be -
Sean P. DeNigris