codecamp

PHP8 RarEntry::getUnpackedSize

(PECL rar >= 0.1)

RarEntry::getUnpackedSize — 获取条目的解压缩大小

说明

public RarEntry::getUnpackedSize(): int

获取存档条目的解压缩大小。

注意:请注意,在具有 32 位 long(包括 Windows)的平台上 x64),返回的最大大小上限为 2 GiB。检查常数PHP_INT_MAX。

参数 

此函数没有参数。

返回值 

返回未打包的大小,或返回出错时的 false。

更新日志 

版本说明
PECL rar 2.0.0此方法现在返回大于 2 GiB(在具有 64 位 ints 且从不使用的平台上) 在其他平台上返回负值。

返回值 

示例 #1 RarEntry::getUnpackedSize() example

<?php

$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");

$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");

echo "Unpacked size of " . $entry->getName() . " = " . $entry->getPackedSize() . " bytes";

?>


PHP8 RarEntry::getStream
PHP8 RarEntry::getVersion
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定