最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php將fileterms函數(shù)返回的結(jié)果變成可讀的形式

 更新時(shí)間:2011年04月21日 23:47:26   作者:  
php將fileterms函數(shù)返回的結(jié)果變成可讀的形式,如: rwx--rx--x
復(fù)制代碼 代碼如下:

function perms_str($perms){
    if (($perms & 0xC000) == 0xC000) {
        // Socket
        $info = 's';
    } elseif (($perms & 0xA000) == 0xA000) {
        // Symbolic Link
        $info = 'l';
    } elseif (($perms & 0x8000) == 0x8000) {
        // Regular
        $info = '-';
    } elseif (($perms & 0x6000) == 0x6000) {
        // Block special
        $info = 'b';
    } elseif (($perms & 0x4000) == 0x4000) {
        // Directory
        $info = 'd';
    } elseif (($perms & 0x2000) == 0x2000) {
        // Character special
        $info = 'c';
    } elseif (($perms & 0x1000) == 0x1000) {
        // FIFO pipe
        $info = 'p';
    } else {
        // Unknown
        $info = 'u';
    }

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

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

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

    return $info;
}

相關(guān)文章

最新評(píng)論

扎兰屯市| 定西市| 建水县| 蒙阴县| 古蔺县| 赤水市| 二连浩特市| 隆尧县| 原阳县| 宿州市| 白朗县| 郓城县| 潼南县| 伊金霍洛旗| 宜兴市| 大庆市| 凤山县| 化隆| 恩平市| 长春市| 岑巩县| 临朐县| 安宁市| 西贡区| 四平市| 盐城市| 腾冲县| 延庆县| 通辽市| 永年县| 南充市| 德庆县| 登封市| 静安区| 明光市| 寿阳县| 孝义市| 宾川县| 宾阳县| 临江市| 青岛市|