Function Resource_fs_base->file_size

Definitions

sources/resource_fs_base_class.php

  • Standard Commandr-fs file size function for resource-fs hooks. Calculates the size of a given resource.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$filename LONG_TEXT No No required parameter N/A N/A Filename OR Resource label
$path string No No required parameter N/A N/A The path (blank: root / not applicable)
$force_calculate boolean No No False N/A N/A Whether to forcefully calculate a size if we normally would have returned -1 for dynamic

Returns

  • The file size (false: error)
  • Type: ~integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Standard Commandr-fs file size function for resource-fs hooks. Calculates the size of a given resource.
 *
 * @param  LONG_TEXT $filename Filename OR Resource label
 * @param  string $path The path (blank: root / not applicable)
 * @param  boolean $force_calculate Whether to forcefully calculate a size if we normally would have returned -1 for dynamic
 * @return ~integer The file size (false: error)
 */

public function file_size(string $filename, string $path, bool $force_calculate = false)