You are here

public function S3fsStreamWrapper::stream_stat in S3 File System 7

Same name and namespace in other branches
  1. 7.2 S3fsStreamWrapper.inc \S3fsStreamWrapper::stream_stat()

Support for fstat().

Return value

array An array with file status, or FALSE in case of an error - see fstat() for a description of this array.

Overrides StreamWrapperInterface::stream_stat

See also

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

File

./S3fsStreamWrapper.inc, line 741
Drupal stream wrapper implementation for S3 File System.

Class

S3fsStreamWrapper
The stream wrapper class.

Code

public function stream_stat() {
  $this
    ->_debug("stream_stat() called for {$this->params['Key']}.");
  $stat = fstat($this->body
    ->getStream());

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