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

search for in the

DirectoryIterator::getSize> <DirectoryIterator::getPathname
[edit] Last updated: Fri, 25 May 2012

view this page in

DirectoryIterator::getPerms

(PHP 5)

DirectoryIterator::getPerms現在の DirectoryIterator アイテムのパーミッションを取得する

説明

public int DirectoryIterator::getPerms ( void )

現在の DirectoryIterator アイテムのパーミッションを取得します。

パラメータ

この関数にはパラメータはありません。

返り値

ファイルのパーミッションを、十進形式の整数値で返します。

例1 DirectoryIterator::getPerms() の例

<?php
$iterator 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$iterator as $fileinfo) {
    if (!
$fileinfo->isDot()) {
        
$octal_perms substr(sprintf('%o'$fileinfo->getPerms()), -4);
        echo 
$fileinfo->getFilename() . " " $octal_perms "\n";
    }
}
?>

上の例の出力は、 たとえば以下のようになります。

apple.jpg 0644
banana.jpg 0644
index.php 0744
pear.jpg 0644

参考



add a note add a note User Contributed Notes DirectoryIterator::getPerms
There are no user contributed notes for this page.

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