-
[clean-tests.git] / old / new-external / test.icl
1 module test
2
3 import iTasks
4 import iTasks.Extensions.Process
5 import System.Time
6 //import System.Process
7
8 Start w = startEngine t w
9
10 t = withShared [] \stdin->withShared ([],[]) \stdout->
11 pipe {tv_sec=0,tv_nsec=100000000}
12 "/bin/ls" ["-a", "/home/mrl"] Nothing
13 "/bin/grep" ["steam"] Nothing Nothing
14 stdin stdout
15 -&&- viewSharedInformation () [] stdout
16 -&&- updateSharedInformation () [] stdin
17
18 //t = withShared [] \inq->
19 // withShared ([], []) \outq->
20 // externalProcess {tv_sec=0,tv_nsec=100000000} "/bin/bash" [] Nothing inq outq (Just termios)
21 // -|| viewSharedInformation "Output" [] outq
22 // -|| forever (enterInformation "Send" [] >>= \nl->upd (\l->l ++ [nl +++ "\n"]) inq)
23 // >>* [OnAction (Action "Stop") (always (treturn ()))]
24 //termios = {defaultPtyOptions & childInNewSession=True, childControlsTty=True, useRawIO = False}