Compare commits
3 Commits
944ed57fcb
...
9e0ca94fea
Author | SHA1 | Date | |
---|---|---|---|
9e0ca94fea | |||
17ca848344 | |||
0711432f7e |
1
Pond.package/CarpException.class/README.md
Normal file
1
Pond.package/CarpException.class/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
I’m an exception that gets thrown when Carp does something funky.
|
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
defaultAction
|
||||||
|
UnhandledError signalForException: self
|
3
Pond.package/CarpException.class/instance/from..st
Normal file
3
Pond.package/CarpException.class/instance/from..st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
instance creation
|
||||||
|
from: anError
|
||||||
|
error := anError
|
14
Pond.package/CarpException.class/properties.json
Normal file
14
Pond.package/CarpException.class/properties.json
Normal 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"
|
||||||
|
}
|
3
Pond.package/CarpProcess.class/class/carp..st
Normal file
3
Pond.package/CarpProcess.class/class/carp..st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
as yet unclassified
|
||||||
|
carp: aString
|
||||||
|
^ self new setCarp: aString
|
3
Pond.package/CarpProcess.class/instance/died.st
Normal file
3
Pond.package/CarpProcess.class/instance/died.st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
died
|
||||||
|
^ excepted isNotNil
|
@@ -1,3 +1,7 @@
|
|||||||
initialization
|
initialization
|
||||||
initialize
|
initialize
|
||||||
proc := OSProcess command: 'carp'
|
proc := OSSUnixSubprocess new command: 'carp';
|
||||||
|
redirectStdin;
|
||||||
|
redirectStdout;
|
||||||
|
redirectStderr;
|
||||||
|
addAllEnvVariablesFromParentWithoutOverride
|
3
Pond.package/CarpProcess.class/instance/isRunning.st
Normal file
3
Pond.package/CarpProcess.class/instance/isRunning.st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
isRunning
|
||||||
|
^ self died not and: proc pid; and: proc exitStatus isNil
|
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
receiveErrorString
|
||||||
|
^ proc stderrStream upToEnd
|
3
Pond.package/CarpProcess.class/instance/receiveString.st
Normal file
3
Pond.package/CarpProcess.class/instance/receiveString.st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
receiveString
|
||||||
|
^ proc stdoutStream upToEnd
|
3
Pond.package/CarpProcess.class/instance/run.st
Normal file
3
Pond.package/CarpProcess.class/instance/run.st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
run
|
||||||
|
[ [ proc run ] on: Error do: [ :err | excepted := err ] ] fork
|
5
Pond.package/CarpProcess.class/instance/sendString..st
Normal file
5
Pond.package/CarpProcess.class/instance/sendString..st
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
accessing
|
||||||
|
sendString: aString
|
||||||
|
proc stdinStream nextPutAll: aString.
|
||||||
|
proc stdinStream close.
|
||||||
|
proc redirectStdin
|
3
Pond.package/CarpProcess.class/instance/setCarp..st
Normal file
3
Pond.package/CarpProcess.class/instance/setCarp..st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
setCarp: aString
|
||||||
|
proc command: aString
|
3
Pond.package/CarpProcess.class/instance/setDir..st
Normal file
3
Pond.package/CarpProcess.class/instance/setDir..st
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
setDir: aString
|
||||||
|
proc environmentAt: 'CARP_DIR' put: aString
|
@@ -6,7 +6,10 @@
|
|||||||
"pools" : [ ],
|
"pools" : [ ],
|
||||||
"classvars" : [ ],
|
"classvars" : [ ],
|
||||||
"instvars" : [
|
"instvars" : [
|
||||||
"proc"
|
"proc",
|
||||||
|
"out",
|
||||||
|
"in",
|
||||||
|
"excepted"
|
||||||
],
|
],
|
||||||
"name" : "CarpProcess",
|
"name" : "CarpProcess",
|
||||||
"type" : "normal"
|
"type" : "normal"
|
||||||
|
@@ -15,3 +15,17 @@ I’ll likely spend a lot of time hunting down the right API; I just
|
|||||||
hope that it even exists.
|
hope that it even exists.
|
||||||
|
|
||||||
## Review
|
## Review
|
||||||
|
|
||||||
|
Time worked: 1h30m
|
||||||
|
|
||||||
|
I got the basics of reading from Carp and writing to Carp working.
|
||||||
|
`OSProcess` turned out not to be what I need, instead I’m now using
|
||||||
|
a library called `OSSubProcess` that has a way more powerful API and
|
||||||
|
better documentation.
|
||||||
|
|
||||||
|
Sadly `OSSubProcess` requires me to close the `stdin` stream after the
|
||||||
|
first chunk of writing to it. I’m not sure whether I can reopen the
|
||||||
|
stream, it seems not to work. I filed [an issue on Github](https://github.com/pharo-contributions/OSSubprocess/issues/51),
|
||||||
|
but I suspect that this is actually not really fixable/not a use
|
||||||
|
case that they want to support. We will see. I gave up getting more
|
||||||
|
done for today.
|
||||||
|
Reference in New Issue
Block a user