略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: RarEntry::isDirectory

2024-04-30

RarEntry::isDirectory

(PECL rar >= 2.0.0)

RarEntry::isDirectoryTest whether an entry represents a directory

说明

public RarEntry::isDirectory(): bool

Tests whether the current entry is a directory.

参数

此函数没有参数。

返回值

Returns true if this entry is a directory and false otherwise.

注释

This function is only available starting with version 2.0.0, but one can also test whether an entry is a directory by checking the entry attributes, like this (only works for files compressed in RAR for Windows or Unix):

<?php
//...
//Open file, get entry and store in variable $e...
//...

$isDirectory = (bool) ((($e->getHostOs() == RAR_HOST_WIN32) && ($e->getAttr() & 0x10)) ||
    ((
$e->getHostOs() == RAR_HOST_UNIX) && (($e->getAttr() & 0xf000) == 0x4000)));
?>
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/rarentry.isdirectory.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3