carp process: reading and writing works for one iteration

This commit is contained in:
2019-12-14 18:22:23 +01:00
parent 0711432f7e
commit 17ca848344
14 changed files with 54 additions and 3 deletions

View File

@@ -0,0 +1 @@
Im an exception that gets thrown when Carp does something funky.

View File

@@ -0,0 +1,3 @@
accessing
defaultAction
UnhandledError signalForException: self

View File

@@ -0,0 +1,3 @@
instance creation
from: anError
error := anError

View File

@@ -0,0 +1,14 @@
{
"commentStamp" : "VeitHeller 12/14/2019 17:49",
"super" : "Exception",
"category" : "Pond",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"parent",
"error"
],
"name" : "CarpException",
"type" : "normal"
}

View File

@@ -0,0 +1,3 @@
accessing
died
^ excepted isNotNil

View File

@@ -1,3 +1,7 @@
initialization initialization
initialize initialize
proc := OSProcess command: 'carp' proc := OSSUnixSubprocess new command: 'carp';
redirectStdin;
redirectStdout;
redirectStderr;
addAllEnvVariablesFromParentWithoutOverride

View File

@@ -0,0 +1,3 @@
accessing
isRunning
^ self died not and: proc pid; and: proc exitStatus isNil

View File

@@ -0,0 +1,3 @@
accessing
receiveErrorString
^ proc stderrStream upToEnd

View File

@@ -0,0 +1,3 @@
accessing
receiveString
^ proc stdoutStream upToEnd

View File

@@ -0,0 +1,3 @@
accessing
run
[ [ proc run ] on: Error do: [ :err | excepted := err ] ] fork

View File

@@ -0,0 +1,5 @@
accessing
sendString: aString
proc stdinStream nextPutAll: aString.
proc stdinStream close.
proc redirectStdin

View File

@@ -1,3 +1,3 @@
accessing accessing
setCarp: aString setCarp: aString
proc := OSProcess command: aString proc command: aString

View File

@@ -0,0 +1,3 @@
accessing
setDir: aString
proc environmentAt: 'CARP_DIR' put: aString

View File

@@ -6,7 +6,10 @@
"pools" : [ ], "pools" : [ ],
"classvars" : [ ], "classvars" : [ ],
"instvars" : [ "instvars" : [
"proc" "proc",
"out",
"in",
"excepted"
], ],
"name" : "CarpProcess", "name" : "CarpProcess",
"type" : "normal" "type" : "normal"