goba Fri Jan 3 16:32:24 2003 EDT Modified files: /phpdoc/en/reference/filesystem/functions chmod.xml mkdir.xml Log: 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. Index: phpdoc/en/reference/filesystem/functions/chmod.xml diff -u phpdoc/en/reference/filesystem/functions/chmod.xml:1.3 phpdoc/en/reference/filesystem/functions/chmod.xml:1.4 --- phpdoc/en/reference/filesystem/functions/chmod.xml:1.3 Tue Aug 13 23:28:02 2002 +++ phpdoc/en/reference/filesystem/functions/chmod.xml Fri Jan 3 16:32:04 2003 @@ -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> @@ -32,6 +32,43 @@ ]]> </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; Index: phpdoc/en/reference/filesystem/functions/mkdir.xml diff -u phpdoc/en/reference/filesystem/functions/mkdir.xml:1.6 phpdoc/en/reference/filesystem/functions/mkdir.xml:1.7 --- phpdoc/en/reference/filesystem/functions/mkdir.xml:1.6 Fri Jan 3 16:11:31 2003 +++ phpdoc/en/reference/filesystem/functions/mkdir.xml Fri Jan 3 16:32:06 2003 @@ -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[
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php