lib/serialization: add README.md
[nit.git] / lib / standard / exec.nit
index 79f9bfd..d9a0704 100644 (file)
@@ -87,13 +87,13 @@ class Process
        private fun basic_exec_execute(p: NativeString, av: NativeString, ac: Int, pf: Int): NativeProcess is extern "exec_Process_Process_basic_exec_execute_4"
 end
 
-# stdout of the process is readable
-class IProcess
+# `Process` on which the `stdout` is readable like a `Reader`
+class ProcessReader
        super Process
-       super IStream
+       super Reader
 
        # File Descriptor used for the input.
-       var stream_in: IFStream is noinit
+       var stream_in: FileReader is noinit
 
        redef fun close do stream_in.close
 
@@ -106,17 +106,17 @@ class IProcess
        redef fun execute
        do
                super
-               stream_in = new IFStream.from_fd(data.out_fd)
+               stream_in = new FileReader.from_fd(data.out_fd)
        end
 end
 
-# stdin of the process is writable
-class OProcess
+# `Process` on which `stdin` is writable like a `Writer`
+class ProcessWriter
        super Process
-       super OStream
+       super Writer
 
        # File Descriptor used for the output.
-       var stream_out: OStream is noinit
+       var stream_out: Writer is noinit
 
        redef fun close do stream_out.close
 
@@ -129,15 +129,15 @@ class OProcess
        redef fun execute
        do
                super
-               stream_out = new OFStream.from_fd(data.in_fd)
+               stream_out = new FileWriter.from_fd(data.in_fd)
        end
 end
 
-# stdin and stdout are both accessible
-class IOProcess
-       super IProcess
-       super OProcess
-       super IOStream
+# `Process` on which stdout can be read and stdin can be written to like a `Duplex`
+class ProcessDuplex
+       super ProcessReader
+       super ProcessWriter
+       super Duplex
 
        redef fun close
        do