public function write($str)
    {
        if (!is_resource($this->pipes['in'])) {
            throw new Exception_SystemProcessIO("stdin is closed or haven't been opened. Cannot write to process");
        }
        $this->debug('writing '.$str.'+newline into stdin');
        fwrite($this->pipes['in'], $str."\n");
        $this->debugStatus();

        return $this;
    }