You are here

public function LocalStream::stream_eof in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::stream_eof()

Tests for end-of-file on a file pointer.

This method is called in response to feof().

Warning, when reading the whole file (for example, with file_get_contents()), PHP will call PhpStreamWrapperInterface::stream_read() followed by PhpStreamWrapperInterface::stream_eof() in a loop but as long as PhpStreamWrapperInterface::stream_read() returns a non-empty string, the return value of PhpStreamWrapperInterface::stream_eof() is ignored.

Return value

bool Should return TRUE if the read/write position is at the end of the stream and if no more data is available to be read, or FALSE otherwise.

Overrides PhpStreamWrapperInterface::stream_eof

See also

feof()

http://php.net/manual/en/streamwrapper.stream-eof.php

File

core/lib/Drupal/Core/StreamWrapper/LocalStream.php, line 195

Class

LocalStream
Defines a Drupal stream wrapper base class for local files.

Namespace

Drupal\Core\StreamWrapper

Code

public function stream_eof() {
  return feof($this->handle);
}