Adding explanation of modes in chmod functions documentation. Feel free

to correct wording if it is not correct. Also moved Nicos' note on modes
here. Point to chmod page from mkdir for mode details.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@110255 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gabor Hojtsy 2003-01-03 21:32:06 +00:00
parent 389b926c1c
commit 99836ba9dd
2 changed files with 41 additions and 4 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.chmod">
<refnamediv>
@ -33,6 +33,43 @@ chmod ("/somedir/somefile", 0755); // octal; correct value of mode
</programlisting>
</informalexample>
</para>
<para>
The <parameter>mode</parameter> parameter consists of three octal
number components specifying access restrictions for the owner,
the user group in which the owner is in, and to everybody else in
this order. One component can be computed by adding up the needed
permissions for that target user base. Number 1 means that you
grant execute rights, number 2 means that you make the file
writeable, number 4 means that you make the file readable. Add
up these numbers to specify needed rights. You can also read more
about modes on UNIX systems with 'man 1 chmod' and 'man 2 chmod'.
<informalexample>
<programlisting role="php">
<![CDATA[
// Read and write for myself, nothing for everybody else
chmod ("/somedir/somefile", 0600);
// Read and write for myself, read for everybody else
chmod ("/somedir/somefile", 0644);
// Everything for myself, read and execute for others
chmod ("/somedir/somefile", 0755);
// Everything for myself, read and execute for my group
chmod ("/somedir/somefile", 0750);
]]>
</programlisting>
</informalexample>
</para>
<para>
<note>
<para>
The current user is the user under which PHP runs. It is
probably not the same user you use for normal shell or FTP
access.
</para>
</note>
</para>
<para>
&return.success;
</para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.39 -->
<refentry id="function.mkdir">
<refnamediv>
@ -31,8 +31,8 @@
</para>
<para>
The mode is 0777 by default, which means the widest possible
access. If you need more information about mode under
UNIX systems, please read 'man 1 chmod' and 'man 2 chmod'.
access. For more information on modes, read the details
on the <function>chmod</function> page.
<informalexample>
<programlisting role="php">
<![CDATA[