socket_write example

if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
        $this->_code=(int)$regs[1];
        return $result;
    }

    function _exec($cmd$fnction="_exec") {
        if(!$this->_ready) {
            $this->PushError($fnction,'Connect first');
            return FALSE;
        }
        if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
        $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF);
        if($status===false) {
            $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream)));
            return FALSE;
        }
        $this->_lastaction=time();
        if(!$this->_readmsg($fnction)) return FALSE;
        return TRUE;
    }

    function _data_prepare($mode=FTP_ASCII) {
        if(!$this->_settype($mode)) return FALSE;
        
Home | Imprint | This part of the site doesn't use cookies.