PHP8 RarEntry::getUnpackedSize

2024-02-25 17:54 更新

(PECL rar >= 0.1)

RarEntry::getUnpackedSize — 獲取條目的解壓縮大小

說明

public RarEntry::getUnpackedSize(): int

獲取存檔條目的解壓縮大小。

注意:請注意,在具有 32 位 long(包括 Windows)的平臺上 x64),返回的最大大小上限為 2 GiB。檢查常數(shù)PHP_INT_MAX。

參數(shù) 

此函數(shù)沒有參數(shù)。

返回值 

返回未打包的大小,或返回出錯時的 false。

更新日志 

版本說明
PECL rar 2.0.0此方法現(xiàn)在返回大于 2 GiB(在具有 64 位 ints 且從不使用的平臺上) 在其他平臺上返回負(fù)值。

返回值 

示例 #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";

?>


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號