--- a/OSProcess.st Tue Feb 21 18:42:24 2017 +0100
+++ b/OSProcess.st Tue Feb 21 18:54:49 2017 +0100
@@ -34,12 +34,13 @@
!
examples
- "
+"
+[exBegin]
|outStream|
outStream := '' writeStream.
- self new
+ OSProcess new
command:'ls -l';
inStream:'abc' readStream;
outStream:outStream;
@@ -47,14 +48,14 @@
execute.
outStream contents
- "
+[exEnd]
- "
+[exBegin]
|outStream|
outStream := '' writeStream.
- self new
+ OSProcess new
command:'ls -l; sleep 10; echo =================================; echo hallo after 10s; echo >&2 +++++++++++++++++++++; cat >&2';
inStream:'abc' readStream;
outStream:outStream;
@@ -62,14 +63,14 @@
startProcess.
outStream inspect
- "
+[exEnd]
- "
+[exBegin]
|outStream|
outStream := '' writeStream.
- self new
+ OSProcess new
command:'ls -l & ls -l >&2';
inStream:'abc' readStream;
outStream:outStream;
@@ -77,7 +78,25 @@
startProcess.
outStream inspect
- "
+[exEnd]
+
+ Execute commands in shell/cmd.exe and read them from stdin:
+
+[exBegin]
+ |outStream|
+
+ outStream := '' writeStream.
+
+ OSProcess new
+ command:'';
+ inStream:'ls -l' readStream;
+ outStream:outStream;
+ lineWise:true;
+ execute.
+
+ outStream contents inspect
+[exEnd]
+"
! !
!OSProcess class methodsFor:'instance creation'!