You are here

public function S3fsStream::stream_stat in S3 File System 8.2

Support for fstat().

Return value

array An array with file status, or FALSE in case of an error.

Overrides PhpStreamWrapperInterface::stream_stat

See also

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

File

src/StreamWrapper/S3fsStream.php, line 737

Class

S3fsStream
Defines a Drupal s3fs (s3fs://) stream wrapper class.

Namespace

Drupal\s3fs\StreamWrapper

Code

public function stream_stat() {
  $this
    ->_debug("stream_stat() called for {$this->uri}.");
  $resource = StreamWrapper::getResource($this->body);
  $stat = fstat($resource);

  // Add the size of the underlying stream if it is known.
  if ($this->access_mode == 'r' && $this->body
    ->getSize()) {
    $stat[7] = $stat['size'] = $this->body
      ->getSize();
  }
  return $stat;
}