Getting the output of a system command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting the output of a system command

ZuLuuuuuu

Hello,

My intention is to write the output of a command I execute inside my
application, into a graphical widget. But first I have to get the output
from execution. When I execute a command like this:

Smalltalk system: 'bla bla bla'

it returns the exit code. When I execute a command via opening a pipe:

pipe := FileStream popen: 'bla bla bla' dir: FileStream read.

I can get the "normal" output by #nextLine etc. But if it exits with an exit
code different then 0, I cannot read any output, for example, #nextLine
returns nil. How can I get the error message as well?


Canol

-----
Canol Gökel
--
View this message in context: http://forum.world.st/Getting-the-output-of-a-system-command-tp3081680p3081680.html
Sent from the Gnu mailing list archive at Nabble.com.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Canol Gökel