Determine whether the file is pointing to a pipe.

@return boolean
@throws SshException
@throws SftpStatusException
194266
public boolean isFifo() throws SftpStatusException, SshException {
		// This is long hand because gcj chokes when it is not? Investigate why
		if ((getAttributes().getPermissions().longValue() & SftpFileAttributes.S_IFIFO) == SftpFileAttributes.S_IFIFO)
			return true;
		return false;
	}
1232108
public function isLink()
    {
        clearstatcache();
        $fs = FileSystem::getFileSystem();
        if ($fs->checkAccess($this) !== true) {
            throw new IOException("No read access to " . $this->path);
        }

        return @is_link($this->path);
    }
58875
public function isPipe()
    {
        if ($this->isPipe === null) {
            $this->isPipe = false;
            if ($this->isAttached()) {
                if (!\is_resource($this->stream)) {
                    throw new \TypeError();
                }
                $mode = (int) \fstat($this->stream)['mode'];
                $this->isPipe = ($mode & self::FSTAT_MODE_S_IFIFO) !== 0;
            }
        }

        return $this->isPipe;
    }
1147345
protected function checkSSHConnection($server = null, $ssh_config_file = null, $verbose = false)
    {
        $server = $server ? $server : $this->hostNameForConfigFile();
        $ssh_config_file =  $ssh_config_file ? $ssh_config_file : $this->sshConfigFile();
        if ($verbose) {
            $this->info("timeout 10 ssh -F $ssh_config_file -q " . $server . ' exit; echo $?');
        }

        $ret = exec("timeout 10 ssh -F $ssh_config_file -q " . $server . ' "exit"; echo $?');
        if ($ret == 0) {
            return true;
        }
        return false;
    }
356471
public boolean isLink() {

		if (sftp.getVersion() > 3) {
			return type == SSH_FILEXFER_TYPE_SYMLINK;
		} else if (permissions != null
				&& (permissions.longValue() & SftpFileAttributes.S_IFLNK) == SftpFileAttributes.S_IFLNK) {
			return true;
		} else {
			return false;
		}
	}
533577
public boolean isDirectory() {
		if (sftp.getVersion() > 3) {
			return type == SSH_FILEXFER_TYPE_DIRECTORY;
		} else if (permissions != null
				&& (permissions.longValue() & SftpFileAttributes.S_IFDIR) == SftpFileAttributes.S_IFDIR) {
			return true;
		} else {
			return false;
		}
	}
1347426
public function isSsl() {
        $server = $this->server();
        if (isset($server[ 'HTTPS' ]) && ('1' == $server[ 'HTTPS' ] || 'on' == strtolower($server[ 'HTTPS' ]))) {
            return true;
        } elseif (isset($server[ 'REQUEST_SCHEME' ]) && 'https' == $server[ 'REQUEST_SCHEME' ]) {
            return true;
        } elseif (isset($server[ 'SERVER_PORT' ]) && ('443' == $server[ 'SERVER_PORT' ])) {
            return true;
        } elseif (isset($server[ 'HTTP_X_FORWARDED_PROTO' ]) && 'https' == $server[ 'HTTP_X_FORWARDED_PROTO' ]) {
            return true;
        }
        return false;
    }
824105
public static function isPtySupported()
    {
        static $result;

        if (null !== $result) {
            return $result;
        }

        if ('\\' === \DIRECTORY_SEPARATOR) {
            return $result = false;
        }

        return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes);
    }
198346
public boolean isCharacter() throws SftpStatusException, SshException {
		// This is long hand because gcj chokes when it is not? Investigate why
		if ((getAttributes().getPermissions().longValue() & SftpFileAttributes.S_IFCHR) == SftpFileAttributes.S_IFCHR) {
			return true;
		}
		return false;
	}
344504
public boolean isSocket() {
		if (permissions != null
				&& (permissions.longValue() & SftpFileAttributes.S_IFSOCK) == SftpFileAttributes.S_IFSOCK) {
			return true;
		}
		return false;
	}
1008686
public function canRead()
    {
        $ht = $this->getHTaccessFilename();
        $fs = $this->getFilesystem();
        if (@$fs->isFile($ht)) {
            $result = @is_readable($ht);
        } else {
            $result = @is_readable(@dirname($ht));
        }

        return $result;
    }
622163
function _list($dir, $raw = true)
    {
        if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
            return false;
        }

        $dir = $this->_realpath($dir . '/');
        if ($dir === false) {
            return false;
        }

        // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.1.2
        if (!$this->_send_sftp_packet(NET_SFTP_OPENDIR, pack('Na*', strlen($dir), $dir))) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        switch ($this->packet_type) {
            case NET_SFTP_HANDLE:
                // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-9.2
                // since 'handle' is the last field in the SSH_FXP_HANDLE packet, we'll just remove the first four bytes that
                // represent the length of the string and leave it at that
                $handle = substr($response, 4);
                break;
            case NET_SFTP_STATUS:
                // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
                $this->_logError($response);
                return false;
            default:
                user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS');
                return false;
        }

        $this->_update_stat_cache($dir, array());

        $contents = array();
        while (true) {
            // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.2.2
            // why multiple SSH_FXP_READDIR packets would be sent when the response to a single one can span arbitrarily many
            // SSH_MSG_CHANNEL_DATA messages is not known to me.
            if (!$this->_send_sftp_packet(NET_SFTP_READDIR, pack('Na*', strlen($handle), $handle))) {
                return false;
            }

            $response = $this->_get_sftp_packet();
            switch ($this->packet_type) {
                case NET_SFTP_NAME:
                    if (strlen($response) < 4) {
                        return false;
                    }
                    extract(unpack('Ncount', $this->_string_shift($response, 4)));
                    for ($i = 0; $i < $count; $i++) {
                        if (strlen($response) < 4) {
                            return false;
                        }
                        extract(unpack('Nlength', $this->_string_shift($response, 4)));
                        $shortname = $this->_string_shift($response, $length);
                        if (strlen($response) < 4) {
                            return false;
                        }
                        extract(unpack('Nlength', $this->_string_shift($response, 4)));
                        $longname = $this->_string_shift($response, $length);
                        $attributes = $this->_parseAttributes($response);
                        if (!isset($attributes['type'])) {
                            $fileType = $this->_parseLongname($longname);
                            if ($fileType) {
                                $attributes['type'] = $fileType;
                            }
                        }
                        $contents[$shortname] = $attributes + array('filename' => $shortname);

                        if (isset($attributes['type']) && $attributes['type'] == NET_SFTP_TYPE_DIRECTORY && ($shortname != '.' && $shortname != '..')) {
                            $this->_update_stat_cache($dir . '/' . $shortname, array());
                        } else {
                            if ($shortname == '..') {
                                $temp = $this->_realpath($dir . '/..') . '/.';
                            } else {
                                $temp = $dir . '/' . $shortname;
                            }
                            $this->_update_stat_cache($temp, (object) array('lstat' => $attributes));
                        }
                        // SFTPv6 has an optional boolean end-of-list field, but we'll ignore that, since the
                        // final SSH_FXP_STATUS packet should tell us that, already.
                    }
                    break;
                case NET_SFTP_STATUS:
                    if (strlen($response) < 4) {
                        return false;
                    }
                    extract(unpack('Nstatus', $this->_string_shift($response, 4)));
                    if ($status != NET_SFTP_STATUS_EOF) {
                        $this->_logError($response, $status);
                        return false;
                    }
                    break 2;
                default:
                    user_error('Expected SSH_FXP_NAME or SSH_FXP_STATUS');
                    return false;
            }
        }

        if (!$this->_close_handle($handle)) {
            return false;
        }

        if (count($this->sortOptions)) {
            uasort($contents, array(&$this, '_comparator'));
        }

        return $raw ? $contents : array_keys($contents);
    }
1145560
public function isFileEmpty()
    {
        $this->openFile();
        $saved_pointer = $this->getFilePointer();
        $this->rewindFile()->seekFileToEnd();
        $size_pointer = $this->getFilePointer();
        $this->seekFile($saved_pointer);

        return $size_pointer === 0;
    }
577426
public function exec(): bool
    {
        $process = proc_open(
            $this->command,
            $this->spec,
            $pipes,
            $this->cwd,
            $this->env
        );

        if (is_resource($process)) {
            if ($this->spec[self::STDIN][0] === "pipe") {
                fwrite($pipes[0], $this->stdin);
                fclose($pipes[0]);
            }
            if ($this->spec[self::STDOUT][0] === "pipe") {
                $this->stdout = stream_get_contents($pipes[1]);
                fclose($pipes[1]);
            }
            if ($this->spec[self::STDERR][0] === "pipe") {
                $this->stderr = stream_get_contents($pipes[2]);
                fclose($pipes[2]);
            }
            $this->exitcode = proc_close($process);
        }
        return ($this->exitcode === 0);
    }
1173213
public static boolean isJTPSlot() {
        return Thread.currentThread().getName().startsWith(GlobalFacadeBase.JTP_BASE_NAME)
                || Thread.currentThread().getName().startsWith(GlobalFacadeBase.HPTP_BASE_NAME);
    }
38394
public function canRead()
    {
        $fs = FileSystem::getFileSystem();

        if ($fs->checkAccess($this)) {
            return (boolean) @is_link($this->getAbsolutePath()) || @is_readable($this->getAbsolutePath());
        }

        return false;
    }
426975
public boolean canWrite() throws SftpStatusException, SshException {
		// This is long hand because gcj chokes when it is not? Investigate why
		if ((getAttributes().getPermissions().longValue() & SftpFileAttributes.S_IWUSR) == SftpFileAttributes.S_IWUSR
				|| (getAttributes().getPermissions().longValue() & SftpFileAttributes.S_IWGRP) == SftpFileAttributes.S_IWGRP
				|| (getAttributes().getPermissions().longValue() & SftpFileAttributes.S_IWOTH) == SftpFileAttributes.S_IWOTH) {
			return true;
		}
		return false;
	}