ホームページ  >  記事  >  バックエンド開発  >  PHP は、fileterms 関数によって返された結果を読み取り可能な form_PHP チュートリアルに変換します

PHP は、fileterms 関数によって返された結果を読み取り可能な form_PHP チュートリアルに変換します

WBOY
WBOYオリジナル
2016-07-21 15:30:06903ブラウズ

复制代符号代码如下:

function perms_str($perms){
if (($perms & 0xC000) == 0xC000) {
// ソケット
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
// シンボリックリンク
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
// 通常
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
// 特殊なブロック
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
// ディレクトリ
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
// 特殊な文字
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
// FIFO パイプ
$info = 'p';
} else {
// 不明
$info = 'u';
}

// 所有者
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : );

// グループ
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : );

// 世界
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : );

$info を返します。
}

www.bkjia.comtru​​ehttp://www.bkjia.com/PHPjc/323288.html技術記事関数 perms_str($perms){ if (($perms nbsp; // ソケット $info = 's'; } elseif (($perms nbsp; // シンボリック リンク $info = 'l'; } elseif (($perms nbsp; // 登録...
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。