📄 function.php-chmod.htm
字号:
<html>
<head>
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
<title>函数:chmod()</title>
<style type="text/css">
a {text-decoration: none;color:#6666ff;}
a:hover {color:#ff0000;}
</style>
</head>
<body bgcolor=ffffff leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>
<p>
<div align=center><table border=0 width=70%><tr>
<td valign=middle width=20><hr size=1 width=100%></td>
<td valign=middle nowrap><font color=e06060 size=+2><b>函数:chmod()</b></font></td>
<td valign=middle width=100%><hr size=1 width=100%></td>
</tr></table></div><p>
<div align=center><table border=0 width=70%><tr><td>
<div align=right><a href="group.php-17.htm" alt="group.php?17">文件系统函数库</a></div><br><h1><font color=0000bb>chmod</font></h1><p>
改变文件的属性。<p>
<font color=ff8000>语法:</font> <b>int chmod(string filename, int mode);</b><p>
<font color=ff8000>返回值:</font> 整数<p>
<font color=ff8000>函数种类:</font> 文件存取<p>
<p><table border=0 cellspacing=0 cellpadding=0 width=100% height=1><tr><td height=1 bgcolor=c0c0c0><table border=0 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td></tr>
<tr><td align=left><font color=ff8000>内容说明</font></td></tr></table><p>本函数用来改变文件的属性。成功则返回 true、失败返回 false。在 mode 值中,系统不会自动将它加入 0 以获得正确的八进位演算,若要正确的使用,可以用下例第二行的方式。<p>
<p><table border=0 cellspacing=0 cellpadding=0 width=100% height=1><tr><td height=1 bgcolor=c0c0c0><table border=0 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td></tr>
<tr><td align=left><font color=ff8000>使用范例</font></td></tr></table><p><font color="#000000">
下二行都是将文件属性设为 rwxr-xr-x,但以第二行较好。<br><br><font color="#0000BB"><?<br>chmod</font><font color="#007700">(</font><font color="#DD0000">"/mydir/myfile"</font><font color="#007700">, </font><font color="#0000BB">755 </font><font color="#007700">); </font><font color="#FF8000">// mode 为十进位,可能有潜在错误<br></font><font color="#0000BB">chmod</font><font color="#007700">(</font><font color="#DD0000">"/mydir/myfile"</font><font color="#007700">, </font><font color="#0000BB">0755 </font><font color="#007700">); </font><font color="#FF8000">// mode 为八进位,确定的属性值<br></font><font color="#0000BB">?></font>
</font>
<p><table border=0 cellspacing=0 cellpadding=0 width=100% height=1><tr><td height=1 bgcolor=c0c0c0><table border=0 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td></tr>
<tr><td align=left><font color=ff8000>参考</font></td></tr></table><p><a href="function.php-chown.htm" alt="function.php?chown">chown()</a> <a href="function.php-chgrp.htm" alt="function.php?chgrp">chgrp()</a> <p><hr size=1><br>如果你对此手册有任何问题,请到下面网址提问: <a href="www.web745.com">WEB开发知识库</a> (<a href="http://www.web745.com">www.web745.com</a>)<p>
</td></tr></table></div>
<p>
<div align=center>
<table border=0>
<tr>
<td>[ <a href="function.php-chgrp.htm" alt="function.php?chgrp">上一页</a>
</td>
<td> <a href="function.php-chown.htm" alt="function.php?chown">下一页</a>
]</td>
</tr>
</table>
</div><p><br><br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -