Determine if a stream is seekable

@return bool
514086
protected function isSeekable()
    {
        $stream = $this->getStream();
        if (!$stream) {
            return false;
        }
        $metadata = stream_get_meta_data($stream);
        return $metadata['seekable'];
    }
1047421
public function isWritable() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getWritable();
		}

		return false;
	}
805452
public function isWritable(): bool
    {
        if ($this->caching == false) {
            return is_writable($this->getAbsoluteFilePath());
        }

        if ($this->isWritable == null) {
            $this->isWritable = is_writable($this->getAbsoluteFilePath());
        }

        return $this->isWritable;
    }
1236378
def is_streamable(self):
        """"""

        doc = self._request(self.ws_prefix + ".getInfo", True)
        return _extract(doc, "streamable") == "1"
46682
function _stream_seek($offset, $whence)
    {
        switch ($whence) {
            case SEEK_SET:
                if ($offset >= $this->size || $offset < 0) {
                    return false;
                }
                break;
            case SEEK_CUR:
                $offset+= $this->pos;
                break;
            case SEEK_END:
                $offset+= $this->size;
        }

        $this->pos = $offset;
        $this->eof = false;
        return true;
    }
92285
private function hasRequestAvailable()
    {
        return (
            null !== $this->application
            && !$this->application->isClientSAPI()
            && $this->application->isStarted()
        );
    }
201059
public function stream_seek($offset, $whence = SEEK_SET) {
		if ($whence == SEEK_SET) $this->pos = $offset;
		elseif ($whence == SEEK_CUR) $this->pos += $offset;
		elseif ($whence == SEEK_END) $this->pos = strlen($this->entry['data']) - $offset;
		else {
			return false;
		}
		return true;
	}
178400
public function seek($offset, $whence = SEEK_SET)
    {
        if (!$this->seekable || $whence !== SEEK_SET) {
            return false;
        }

        $success = true;
        $this->pos = $this->current = 0;

        // Rewind each stream
        foreach ($this->streams as $stream) {
            if (!$stream->seek(0)) {
                $success = false;
            }
        }

        if (!$success) {
            return false;
        }

        // Seek to the actual position by reading from each stream
        while ($this->pos < $offset && !$this->eof()) {
            $this->read(min(8096, $offset - $this->pos));
        }

        return $this->pos == $offset;
    }
714727
public function isSeekable() : bool
	{
		if (! \is_resource($this->resource))
		{
			return false;
		}

		$metadata = \stream_get_meta_data($this->resource);

		return $metadata['seekable'];
	}
712532
public function closeStream() {
        if ($this->isFinalized || strlen($this->streamFilePath) == 0) {
            return FALSE;
        }

        fflush($this->streamData);
        fclose($this->streamData);

        $this->processFile($this->streamFile, $this->streamFilePath, $this->streamTimestamp, $this->streamFileComment, $this->streamExtFileAttr);

        $this->streamData = null;
        $this->streamFilePath = null;
        $this->streamTimestamp = null;
        $this->streamFileComment = null;
        $this->streamFileLength = 0;
        $this->streamExtFileAttr = null;

        // Windows is a little slow at times, so a millisecond later, we can unlink this.
        unlink($this->streamFile);

        $this->streamFile = null;

        return TRUE;
    }
804459
public function stream_seek($offset, $whence)
	{
		// $whence: SEEK_SET, SEEK_CUR, SEEK_END
		if ($offset > $this->len)
		{
			// We can't seek beyond our len.
			return false;
		}

		switch ($whence)
		{
			case SEEK_SET:
				$this->pos = $offset;
				break;

			case SEEK_CUR:
				if (($this->pos + $offset) < $this->len)
				{
					$this->pos += $offset;
				}
				else
				{
					return false;
				}
				break;

			case SEEK_END:
				$this->pos = $this->len - $offset;
				break;
		}

		return true;
	}
1322929
public function stream_flush()
    {
        if (!$this->getResource()) {
            return false;
        }

        $buffer = $this->getDataBuffer();
        $bufferWritten = $buffer;
        $retVal = true;
        if (!empty($buffer)) {

            $object = $this->getResource()->getObject();
            $mimetype = $this->getService()->guessFileType($this->getResource()->getResourceName());
            $object->content_type = $mimetype;
            $object->setData($buffer);
            $object->Create();
        }

       if (strlen($bufferWritten) ==  strlen($buffer)) {
            $this->setDataBuffer(null);
        } else {
            $this->setDataBuffer($buffer);
        }
        $this->setDataBuffer(null);

        return $retVal;
    }
1064579
protected function checkStream()
    {
        // Find document content type
        while ( !feof( $this->stream ) )
        {
            $line = fgets( $this->stream );

            // Check if we found a new document definition
            if ( !preg_match( '(^Content-Type:\\s+(?P<type>[a-z*][a-z0-9_/*+.-]*)(;\s*(?P<options>.*))?$)', trim( $line ), $match ) )
            {
                continue;
            }

            $type    = $match['type'];
            $options = isset( $match['options'] ) ? preg_split( '(\s*;\s*)', $match['options'] ) : array();
            foreach ( $options as $option )
            {
                if ( preg_match( '(^(?P<key>[a-z-]+)=("?)(?P<value>.*?)\\2$)', $option, $match ) )
                {
                    $this->options[$match['key']] = $match['value'];
                }
            }

            if ( $type !== 'multipart/mixed' )
            {
                throw new phpillowMultipartParserException( 'This handler does only understand "multipart/mixed" documents.' );
            }

            break;
        }

        // Search for first starting boundary
        while ( !feof( $this->stream ) )
        {
            if ( trim( fgets( $this->stream ) ) === '--' . $this->options['boundary'] )
            {
                break;
            }
        }
    }
1202963
private function isStreamWritable($path)
    {
        $stream = $this->getStreamByPathScheme($path);
        if ($stream instanceof StreamInterface) {
            return $stream->isWritable();
        }

        return false;
    }
27644
private function hasSttyAvailable(): bool
    {
        if (null !== self::$stty) {
            return self::$stty;
        }

        exec('stty 2>&1', $output, $exitcode);

        return self::$stty = 0 === $exitcode;
    }
1201649
public function isTranslable()
    {
        if ($this->getPath() === null) {
            $this->detectUrlDetails();
        }

        foreach ($this->config->getExcludedUrls() as $regex) {
            $escapedRegex = Text::escapeForRegex(Text::fullTrim($regex));
            $fullRegex = sprintf('/%s/', $escapedRegex);

            if (preg_match($fullRegex, $this->getPath()) === 1) {
                return false;
            }
        }

        return true;
    }
41545
public function isWritable()
    {
        return in_array($this->mode, [
            StreamMode::WRITE_CLEAN,
            StreamMode::WRITE_END,
            StreamMode::CREATE_READ_WRITE,
            StreamMode::CREATE_WRITE,
            StreamMode::READ_WRITE,
            StreamMode::READ_WRITE_CLEAN,
            StreamMode::READ_WRITE_END,
        ]);
    }