diff options
| author | Drahflow <drahflow@gmx.de> | 2015-05-06 14:04:37 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-05-06 14:04:37 +0200 |
| commit | 2a48e335db1ce4e649cb05895c85923740973899 (patch) | |
| tree | 660b8dbcb7312e0ab247885285964d95f9a1e77e | |
| parent | f4a118394fc9dd1ba6c295bf22218724be8d3038 (diff) | |
Access to file descriptors
| -rw-r--r-- | TODO | 1 | ||||
| -rw-r--r-- | elymas/lib/sys.ey | 8 |
2 files changed, 5 insertions, 4 deletions
@@ -16,3 +16,4 @@ * input prompt * better interactive error handling when interpreting from stdin * document ALL THE LIBRARIES +* consider https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system and finally make the stuff typed correctly diff --git a/elymas/lib/sys.ey b/elymas/lib/sys.ey index 8f128cb..fe4f4b6 100644 --- a/elymas/lib/sys.ey +++ b/elymas/lib/sys.ey @@ -49,7 +49,7 @@ # 0 -> a shell command { ==cmd - "/bin/sh" [ "sh" "-c" cmd "\0" cat ] [ ] +execve ??proc.exec + "/bin/sh" [ "sh" "-c" cmd ] { "\0" cat } '*0.0 [ ] +execve ??proc.exec } /shell sys .deff # 0 -> function to execute in the child @@ -79,9 +79,9 @@ child < ==pid { pid 0 +waitpid -- } =*wait { pid -01 +kill -- } =*kill - writeA sys .fdToFile _ .writeonly ==in - readB sys .fdToFile _ .readonly ==out - readC sys .fdToFile _ .readonly ==err + writeA _ ==inFd sys .fdToFile _ .writeonly ==in + readB _ ==outFd sys .fdToFile _ .readonly ==out + readC _ ==errFd sys .fdToFile _ .readonly ==err > } ? * } /spawn sys .deff |
