function is_readable($path)
    {
        $path = $this->_realpath($path);

        $packet = pack('Na*N2', strlen($path), $path, NET_SFTP_OPEN_READ, 0);
        if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        switch ($this->packet_type) {
            case NET_SFTP_HANDLE:
                return true;
            case NET_SFTP_STATUS: // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
                return false;
            default:
                user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS');
                return false;
        }
    }
function is_readable($path)
    {
        $path = $this->_realpath($path);

        $packet = pack('Na*N2', strlen($path), $path, NET_SFTP_OPEN_READ, 0);
        if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        switch ($this->packet_type) {
            case NET_SFTP_HANDLE:
                return true;
            case NET_SFTP_STATUS: // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
                return false;
            default:
                user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS');
                return false;
        }
    }
function is_readable ( $ path ) { $ path = $ this -> _realpath ( $ path ) ; $ packet = pack ( 'Na*N2' , strlen ( $ path ) , $ path , NET_SFTP_OPEN_READ , 0 ) ; if ( ! $ this -> _send_sftp_packet ( NET_SFTP_OPEN , $ packet ) ) { return false ; } $ response = $ this -> _get_sftp_packet ( ) ; switch ( $ this -> packet_type ) { case NET_SFTP_HANDLE : return true ; case NET_SFTP_STATUS : // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED return false ; default : user_error ( 'Expected SSH_FXP_HANDLE or SSH_FXP_STATUS' ) ; return false ; } }
Tells whether a file exists and is readable

@param string $path
@return bool
@access public
Tells whether a file exists and is readable