Retrieves information about a file resource.

@return array A similar array to fstat().

@see fstat()
358859
public function stream_stat()
    {
        // Get metadata from original file.
        $stat = $this->url_stat($this->uri, static::STREAM_URL_IGNORE_SIZE | STREAM_URL_STAT_QUIET) ?: [];

        // Newly created file.
        if (empty($stat['mode'])) {
            $stat['mode'] = 0100000 + $this->getConfiguration('permissions')['file']['public'];
            $stat[2] = $stat['mode'];
        }

        // Use the size of our handle, since it could have been written to or
        // truncated.
        $stat['size'] = $stat[7] = StreamUtil::getSize($this->handle);

        return $stat;
    }
999294
public function getFileSetIDs()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $rows = $db->fetchAll('select fsID from FileSetFiles where fID = ?', [$this->getFileID()]);
        $ids = array_map('intval', array_map('array_pop', $rows));

        return $ids;
    }
442106
public function getData()
    {
        if (!$this->data && $this->getLocation()) {
            $this->data = file_get_contents($this->getLocation());
        }

        return $this->data;
    }
773538
public function getFileContents()
        {
            if ($this->fileContentsCache === null && $filePath = $this->getFile()) {

                // Return null if the file doesn't actually exist - this may
                // happen in cases where the filename is provided as, for
                // example, 'Unknown'
                if (!File::exists($filePath)) {
                    return null;
                }

                $this->fileContentsCache = File::read($filePath);
            }

            return $this->fileContentsCache;
        }
1120007
public function getPidfile()
    {
        $resource = false;

        if (isset($this->pidfile) && is_readable($this->pidfile)) {
            $resource = fopen($this->pidfile, 'r');
        }

        return $resource ? $resource : null;
    }
1288525
public function getFiles() : array
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return array_map(function($file) {
            return new File($this->getPath(). DIRECTORY_SEPARATOR .$file);
        }, $this->_files);
    }
325139
protected function getContents()
    {
        // Cancel if the file doesn't exist
        if (!$this->getFilesystem()->has($this->getFilepath())) {
            return [];
        }

        // Get and parse file
        if ($this->contents === null) {
            $this->contents = $this->getFilesystem()->read($this->getFilepath());
            $this->contents = json_decode($this->contents, true);
        }

        return (array) $this->contents;
    }
498480
public function getFileInfo()
    {
        $fileInfo = $this->getCachedValue('fileInfo');
        if ($fileInfo === false) {

            $data = $this->dataProvider->getData();

            $fileInfo = array();

            foreach ($data as $packageId => $info) {
                $provides = $this->getProvidesForPackage($packageId);
                foreach ($provides as $file => $providesInfo) {
                    if (isset($providesInfo['Minify'])) {
                        $providesInfo['Minify'] = $this->parseBoolean(
                            $providesInfo['Minify']
                        );
                    } else {
                        $providesInfo['Minify'] = true;
                    }
                    $providesInfo['Package'] = $packageId;
                    $fileInfo[$file] = $providesInfo;
                }
            }

            $this->setCachedValue('fileInfo', $fileInfo);
        }

        return $fileInfo;
    }
1188230
public function getFiles()
    {
        if(!$this->isPropertyAvailable('Files')){
            $this->setProperty("Files", new FileCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(), "Files")));
        }
        return $this->getProperty("Files");
    }
767348
public function get()
    {
        return [
            'type' => 'typeof',
            'left' => $this->leftOperand->get(),
            'file' => $this->file,
            'line' => $this->line,
            'char' => $this->char,
        ];
    }
1313755
public function get()
    {
        $handle   = fopen($this->filePath, "rb");
        $fileSize = filesize($this->filePath);

        $hash = array(
            3 => 0,
            2 => 0,
            1 => ($fileSize >> 16) & 0xFFFF,
            0 => $fileSize & 0xFFFF
        );

        for ($i = 0; $i < 8192; $i++) {
            $tmp  = $this->readUINT64($handle);
            $hash = $this->addUINT64($hash, $tmp);
        }

        $offset = $fileSize - 65536;
        fseek($handle, $offset > 0 ? $offset : 0, SEEK_SET);

        for ($i = 0; $i < 8192; $i++) {
            $tmp  = $this->readUINT64($handle);
            $hash = $this->addUINT64($hash, $tmp);
        }

        fclose($handle);

        return $this->uINT64FormatHex($hash);
    }
551254
public function getFunctions()
    {
        if (!isset($this->fileFunctions)) {
            $this->fileFunctions = $this->findFunctions();
        }

        return $this->fileFunctions;
    }
773427
public function getFiles()
    {
        $files = array();
        while ($this->valid() && $this->isFile()) {
            if (!$this->searchPattern) {
                $files[] = $this->current();
            } elseif(preg_match($this->searchPattern, $this->getFilename())) {
                $files[] = $this->current();
            }
            $this->next();
        }
        return $files;
    }
486023
public function get_files() {
        // The files array can contain stored file ids, so we need to get instances if asked.
        foreach ($this->files as $id => $listfile) {
            if (is_numeric($listfile)) {
                $fs = get_file_storage();

                if ($file = $fs->get_file_by_id($id)) {
                    $this->files[$id] = $file;
                } else {
                    unset($this->files[$id]); // Index is out of date and referencing a file that does not exist.
                }
            }
        }

        return $this->files;
    }
1360794
public function details()
  {
    $file = $this->file;

    if (file_exists($file)) {
      $data = unserialize($this->decrypt(file_get_contents($file)));

      return [
        'records' => count($data),
        'size' => round(filesize($file) / 1024, 1),
        'updated_at' => date('Y-m-d h:i:s', filemtime($file))
      ];
    }

    return null;
  }
402863
public function getArchiveSize() {
        if (!is_resource($this->zipFile)) {
            return strlen($this->zipData);
        }
        $filestat = fstat($this->zipFile);

        return $filestat['size'];
    }
385685
public function getFileInfo()
    {
        $prefix = str_replace(yii::getAlias(yii::getAlias('@frontend/web')), '', yii::getAlias('@ueditor'));
        return array(
            "state" => $this->stateInfo,
            "url" => $prefix . $this->fullName,
            "title" => $this->fileName,
            "original" => $this->oriName,
            "type" => $this->fileType,
            "size" => $this->fileSize
        );
    }