"PHP fileperms()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-<source lang='cli'> +<source lang='console'>))
잔글 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))
46번째 줄: 46번째 줄:
*[[퍼미션]]
*[[퍼미션]]


==참고 자료==
==참고==
* http://php.net/manual/en/function.fileperms.php
* http://php.net/manual/en/function.fileperms.php


[[분류: PHP]]
[[분류: PHP]]
[[분류: 파일]]
[[분류: 파일]]

2017년 6월 27일 (화) 12:24 판

1 개요

PHP fileperms()
  • 파일(또는 폴더)의 퍼미션을 조회하는 PHP 함수

2 예시 1

root@zetawiki:~# stat -c%A /etc/passwd
-rw-r--r--
root@zetawiki:~# stat -c%a /etc/passwd
644
var_dump( fileperms('/etc/passwd') );
# int(33188)
var_dump( decoct(fileperms('/etc/passwd')) );
# string(6) "100644"
var_dump( decoct(fileperms('/etc/passwd') & 07777) );
# string(3) "644"
var_dump( decoct(fileperms('/etc/passwd') & 0777) );
# string(3) "644"

3 예시 2

root@zetawiki:~# stat -c%A /tmp
drwxrwxrwt
root@zetawiki:~# stat -c%a /tmp
1777
var_dump( fileperms('/tmp') );
# int(17407)
var_dump( decoct(fileperms('/tmp')) );
# string(5) "41777"
var_dump( decoct(fileperms('/tmp') & 07777) );
# string(4) "1777"
var_dump( decoct(fileperms('/tmp') & 0777) );
# string(3) "777"

4 같이 보기

5 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}