downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

RarEntry::isEncrypted> <RarEntry::getVersion
[edit] Last updated: Wed, 19 Jun 2013

view this page in

RarEntry::isDirectory

(PECL rar >= 2.0.0)

RarEntry::isDirectoryTest whether an entry represents a directory

Description

public bool RarEntry::isDirectory ( void )

Tests whether the current entry is a directory.

Parameters

This function has no parameters.

Return Values

Returns TRUE if this entry is a directory and FALSE otherwise.

Notes

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 note add a note User Contributed Notes RarEntry::isDirectory - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites