Returns the file size, in bytes, or false, on failure

Files larger than 4GB will show up as being exactly 4GB.

@param string $filename
@return mixed
@access public
484962
function size($filename)
    {
        if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
            return false;
        }

        $result = $this->stat($filename);
        if ($result === false) {
            return false;
        }
        return isset($result['size']) ? $result['size'] : -1;
    }
931798
public function getMimeType($filename)
    {
        $file_info = pathinfo($filename);
        $extension = isset($file_info['extension']) ? $file_info['extension'] : '';

        if (isset(self::$mimeTypeMap[$extension])) {
            $mime = self::$mimeTypeMap[$extension];
        } else {
            $finfo = finfo_open(FILEINFO_MIME_TYPE);
            $mime = finfo_file($finfo, $filename);
        }
        return $mime;
    }
427878
public function getFileData($fileName)
    {
        if (!isset($this->filesData[$fileName]))
            return false;

        return new ArchiveEntry($fileName, $this->filesData[$fileName]['size'],
            $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'],false);
    }
164346
public function size()
    {
        $position = ftell($this->_fileHandle);
        fseek($this->_fileHandle, 0, SEEK_END);
        $size = ftell($this->_fileHandle);
        fseek($this->_fileHandle, $position);

        return $size;
    }
1346109
public function getFile($fileName)
    {
        $result = false;

        if (isset($_FILES[$fileName])) {
            $result = $_FILES[$fileName];
        }

        return $result;
    }
1103712
public function getLogFileContent($filename = 'connector')
    {
        switch ($filename) {
            case "connector":
                $filename = 'connector.log';
                break;
            case "system":
                $filename = 'system.log';
                break;
            case "exception":
                $filename = 'exception.log';
                break;
            case "debug":
                $filename = 'debug.log';
                break;
            default:
                return "Log file is not valid. Log file name is " . $filename;
        }
        $pathLogfile = $this->directoryList->getPath('log') . DIRECTORY_SEPARATOR . $filename;
        //tail the length file content
        $lengthBefore = 500000;
        try {
            $contents = '';
            $handle = fopen($pathLogfile, 'r');
            fseek($handle, -$lengthBefore, SEEK_END);
            if (!$handle) {
                return "Log file is not readable or does not exist at this moment. File path is "
                . $pathLogfile;
            }

            if (filesize($pathLogfile) > 0) {
                $contents = fread($handle, filesize($pathLogfile));
                if ($contents === false) {
                    return "Log file is not readable or does not exist at this moment. File path is "
                        . $pathLogfile;
                }
                fclose($handle);
            }
            return $contents;
        } catch (\Exception $e) {
            return $e->getMessage() . $pathLogfile;
        }
    }
133596
public static function checkFile($filename)
    {
        $fileContents = (is_file($filename) && is_readable($filename)) ? @file_get_contents($filename) : false;
        if ($fileContents === false) {
            throw new Exception('Failed to load the file '.$filename);
        }

        return static::checkString($fileContents, $filename);
    }
174804
public function getFileResource($fileName)
    {
        $Location = array_search($fileName, $this->files, true);
        if (!isset($this->filesData[$fileName])) return false;
        $data = $this->filesData[$fileName];
        $Location_Real = $Location * $this->blockSize;
        if ($this->iso->Seek($Location_Real, SEEK_SET) === false)
            return false;

        $resource = fopen('php://temp', 'r+');
        fwrite($resource, $this->iso->Read($data['size']));
        rewind($resource);
        return $resource;
    }
680914
static function size($filename, $returnFormatted = false) {
        if ($returnFormatted && self::isReadable($filename)) {
            return Number::readableSize((double)filesize($filename));
        }

        return file_exists($filename) ? filesize($filename) : 0;
    }
393038
public static function getFileSize($path)
    {
        if (is_file($path)) {
            return filesize($path);
        } elseif (substr($path, 0, 6) == 'ftp://') {
            return self::getFileSizeFtp($path);
        } elseif (substr($path, 0, 4) == 'http') {
            return self::getFileSizeHttp($path);
        } else {
            return 0;
        }
    }
1167899
public static function filesize($bytes)
    {
        $precision = (($bytes % 1024) === 0 || $bytes <= 1024) ? 0 : 1;

        $formatter = new ByteSize\Formatter\Binary();
        $formatter->setPrecision($precision);

        return $formatter->format($bytes);
    }
1299792
private function guessFromExtension($filename)
    {
        $output = 'text';
        $pInfo = pathinfo($filename);
        if (isset($pInfo['extension'])) {
            foreach ($this->fileTypes as $extension => $lexer) {
                if ($extension === $pInfo['extension']) {
                    return $lexer;
                }
            }
        }

        return $output;
    }
1238440
protected static function getFilesize($filesize)
    {
        $value = (float)($filesize);
        $unit = substr($filesize, -1);

        switch ($unit) {
            case 'K':
                return $value / 1024;
            case 'G':
                return $value * 1024;
            case 'M':
            default:
                return $value;
        }
    }
866003
public function getFile( $fileName )
	{
		if( !$this->numFiles )
			return NULL;
		foreach( $this->files as $key => $information )
			if( $information['name'] == $fileName )
				return $information;
	}
45652
public static function getFileNameWithoutExtension($fileName)
    {
        $matches = [];

        if (is_string($fileName) && (bool)preg_match('|(.+)\.(.+)|', $fileName, $matches)) {
            return $matches[1];
        }

        return '';
    }
206968
public function fileSize($size) {
        $this->p1 = $size;
        $this->check_role = 'fileSize';
        if ($this->value instanceof File) {
            $result = filesize($this->value->path_tmp) <= $this->strToSize($size) ;
        } else {
            $result = filesize($this->value) <= $this->strToSize($size) ;
        }
        $this->checkResult($result);
        return $this;
    }
294576
public static function getFileExtAttr($filename) {
        if (file_exists($filename)) {
            $fp = fileperms($filename) << 16;
            return $fp | (is_dir($filename) ? self::S_DOS_D : self::S_DOS_A);
        }
        return FALSE;
    }