Linux 系統中采用三位十進制數表示權限,如0755, 0644
ABCD
A- 0, 表示十進制
B-用戶
C-組用戶
D-其他用戶
利用 ls -l可以查看文件的權限
--- -> 0 (no excute , no write ,no read)
--x -> 1 excute, (no write, no read)
-w- -> 2 write
-wx -> 3 write, excute
r-- -> 4 read
r-x -> 5 read, excute
rw- -> 6 read, write ,
rwx -> 7 read, write , excute
0755->即用戶具有讀/寫/執行權限,組用戶和其它用戶具有讀寫權限;
0644->即用戶具有讀寫權限,組用戶和其它用戶具有只讀權限;
一般賦予目錄0755權限,文件0644權限。
如:
use Cwd;
$PATH = getcwd;
mkdir($PATH/path, 0755);
# make a new folder in current working diectory.