public function readAll($res = 'out')
    {
        $str = '';
        $this->debugStatus();
        $this->debug('reading all output');
        //stream_set_blocking($this->pipes[$res],0);
        $str = stream_get_contents($this->pipes[$res]);
        $this->close($res);
        if (substr($str, -1) != "\n") {
            $str .= "\n";
        }

        return $str;
    }