php chmod()函数
定义chmod()函数更改指定文件的权限。 语法PHP chmod()函数具有以下语法。 chmod(file,mode) 参数参数 是否必须 描述 file 需要。 要检查的文件 mode 需要。 新权限。 mode参数由四个数字组成: 第一个数字始终为零 第二个数字指定所有者的权限 第三个数字指定所有者的用户组的权限 第四个数字指定其他人的权限 可能的值(要设置多个权限,请添加以下数字): 1 =执行权限 2 =写权限 4 =读取权限 返回值成功时返回TRUE,失败时返回FALSE。 实例/* http://www.manongjc.com/article/1763.html 作者:脚本之家教程 */ //sets the file to readable,writable,and executable by all users chmod("/var/www/myfile.txt",0777); //sets the file to readable,and executable by owner, //and just readable and writable by everyone else. chmod("/var/www/myfile.txt",0755); // Read and write for owner,nothing for everybody else chmod("test.txt",0600); // Read and write for owner,read for everybody else chmod("test.txt",0644); // Everything for owner,read for owner's group chmod("test.txt",0740); ?> (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
