php之chmod()函数

Definition and Usage
定义和用法

The chmod() function changes permissions of the specified file.
chmod()函数的作用是:改变指定文件的模式。

Returns TRUE on success and FALSE on failure.
函数执行成功返回True,执行失败返回False。

Syntax
语法

chmod(file,mode)

 

Parameter
参数
Description
描述
fileRequired. Specifies the file to check
必要参数。指定文件对象
modeRequired. Specifies the new permissions.
必要参数。指定新的特许[permission]:

The mode parameter consists of four numbers:
Mode[模式]参数有四个数字组成:
  • The first number is always zero
    第一个数字通常是0
  • The second number specifies permissions for the owner
    第二个数字指定所有者的特许
  • The third number specifies permissions for the owner's user group
    第三个数字指定所有者用户群特许
  • The fourth number specifies permissions for everybody else
    第四个数子指定了所有人的特许

Possible values (to set multiple permissions, add up the following numbers):
可用值(为了设置多组特许,可以通过添加下面的数字)

  • 1 = execute permissions
    1 = 执行特许
  • 2 = write permissions
    2 = 可写特许
  • 4 = read permissions
    4 = 可读特许

 


Example
案例

<?php// Read and write for owner, nothing for everybody elsechmod("test.txt","0600");
// Read and write for owner, read for everybody elsechmod("test.txt","0644");
// Everything for owner, read and execute for everybody elsechmod("test.txt","0755");
// Everything for owner, read for owner's groupchmod("test.txt","0740");?> 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值