lib: Split collections into readable and writable
[nit.git] / lib / standard / exec.nit
index 171f3e9..72dd195 100644 (file)
@@ -61,7 +61,7 @@ class Process
        # Internal code to handle execusion
        protected init execute(command: String, arguments: Array[String], pipeflags: Int)
        do
-               var args = new String
+               var args = new Buffer
                var l = 1 # Number of elements in args
                args.append(command)
                if arguments != null then
@@ -71,7 +71,7 @@ class Process
                        end
                        l += arguments.length
                end
-               _data = basic_exec_execute(command.to_cstring, args.to_cstring, l, pipeflags)
+               _data = basic_exec_execute(command.to_cstring, args.to_s.to_cstring, l, pipeflags)
        end
        
        attr _data: NativeProcess
@@ -90,13 +90,13 @@ special IStream
 
        redef meth eof do return _in.eof
 
-       redef init(command: String, arguments: String...)
+       init(command: String, arguments: String...)
        do
                execute(command, arguments, 2)
                _in = new FDIStream(_data.out_fd)
        end
        
-       redef init init_(command: String)
+       init init_(command: String)
        do
                execute(command, null, 2)
                _in = new FDIStream(_data.out_fd)
@@ -115,13 +115,13 @@ special OStream
 
        redef meth write(s) do _out.write(s)
        
-       redef init(command: String, arguments: String...)
+       init(command: String, arguments: String...)
        do
                execute(command, arguments, 1)
                _out = new FDOStream(_data.in_fd)
        end
        
-       redef init init_(command: String)
+       init init_(command: String)
        do
                execute(command, null, 1)
                _out = new FDOStream(_data.in_fd)
@@ -140,14 +140,14 @@ special IOStream
                _out.close
        end
 
-       redef init(command: String, arguments: String...)
+       init(command: String, arguments: String...)
        do
                execute(command, arguments, 3)
                _in = new FDIStream(_data.out_fd)
                _out = new FDOStream(_data.in_fd)
        end
        
-       redef init init_(command: String)
+       init init_(command: String)
        do
                execute(command, null, 3)
                _in = new FDIStream(_data.out_fd)