cvs: phpdoc-zh /reference/dir/functions chdir.xml chroot.xml class.dir.xml closedir.xml getcwd.xml opendir.xml readdir.xml rewinddir.xml
| From: | Dallas Thunder | Date: | Sat, 21 Sep 2002 02:47:54 +0000 |
| Subject: | cvs: phpdoc-zh /reference/dir/functions chdir.xml chroot.xml class.dir.xml closedir.xml getcwd.xml opendir.xml readdir.xml rewinddir.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-623@lists.php.net to get a copy of this message | ||
dallas Fri Sep 20 22:47:54 2002 EDT
Added files:
/phpdoc-zh/reference/dir/functions chdir.xml chroot.xml
class.dir.xml closedir.xml
getcwd.xml opendir.xml
readdir.xml rewinddir.xml
Log:
Translation completed.
Index: phpdoc-zh/reference/dir/functions/chdir.xml +++ phpdoc-zh/reference/dir/functions/chdir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.chdir"> <refnamediv> <refname>chdir</refname> <refpurpose>¸Ä±äĿ¼</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>chdir</methodname> <methodparam><type>string</type><parameter>directory</parameter></methodparam> </methodsynopsis> <para> ½« PHP µÄµ±Ç°Ä¿Â¼¸ÄΪ <parameter>directory</parameter>¡£Èç¹û²»ÄܸıäĿ¼Ôò·µ»Ø &false;£¬·ñÔò·µ»Ø &true;¡£ </para> <para> ²Î¼û <function>getcwd</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/chroot.xml +++ phpdoc-zh/reference/dir/functions/chroot.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.chroot"> <refnamediv> <refname>chroot</refname> <refpurpose>¸Ä±ä¸ùĿ¼</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>chroot</methodname> <methodparam><type>string</type><parameter>directory</parameter></methodparam> </methodsynopsis> <para> ½«µ±Ç°½ø³ÌµÄ¸ùĿ¼¸Ä±äΪ <parameter>directory</parameter>¡£Èç¹û²»Äܸıä¸ùĿ¼Ôò·µ»Ø &false;£¬·ñÔò·µ»Ø &true;¡£ </para> <note> <para> µ±ÔËÐÐÓÚ web ·þÎñÆ÷»·¾³ÏÂʹÓô˺¯Êý²¢²»´ÏÃ÷£¬ÒòΪÔÚÇëÇó½áÊøÊ±²»¿ÉÄܽ«¸ùÄ¿Â¼ÖØÉèΪ /¡£ÕâÖÐÇé¿öϱ¾º¯Êý½öÔÚ×÷Ϊ CGI ÔËÐÐʱÄÜÕýÈ·¹¤×÷¡£ </para> </note> ¬e.no-windows; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/class.dir.xml +++ phpdoc-zh/reference/dir/functions/class.dir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="class.dir"> <refnamediv> <refname>dir</refname> <refpurpose>directory Àà</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <classsynopsis> <ooclass><classname>dir</classname></ooclass> <constructorsynopsis> <methodname>dir</methodname> <methodparam><type>string</type><parameter>directory</parameter></methodparam> </constructorsynopsis> <fieldsynopsis> <type>string</type><varname>path</varname> </fieldsynopsis> <methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis> <methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis> <methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis> </classsynopsis> <para> ÕâÊǸö·Â̡̾Ïò¶ÔÏóµÄ»úÖÆÀ´¶Áȡһ¸öĿ¼¡£¸ø¶¨µÄ <parameter>directory</parameter> ±»´ò¿ª¡£Ò»µ©Ä¿Â¼±»´ò¿ª£¬ÓÐÁ½¸öÊôÐÔ¿ÉÓá£handle ÊôÐÔ¿ÉÒÔÓÃÔÚÆäËüĿ¼º¯ÊýÀýÈç <function>readdir</function>£¬<function>rewinddir</function> ºÍ <function>closedir</function> ÖС£path ÊôÐÔ±»ÉèΪ±»´ò¿ªµÄĿ¼·¾¶¡£ÓÐÈý¸ö·½·¨¿ÉÓãºread£¬rewind ºÍ close¡£ </para> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>dir</function> ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹¡£ <example> <title><function>dir</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ $d = dir("/etc"); echo "Handle: ".$d->handle."<br>\n"; echo "Path: ".$d->path."<br>\n"; while (false !== ($entry = $d->read())) { echo $entry."<br>\n"; } $d->close(); ]]> </programlisting> </example> </para> <note> <para> read ·½·¨·µ»ØµÄĿ¼ÏîµÄ˳ÐòÒÀÀµÓÚϵͳ¡£ </para> </note> <note> <para> ±¾º¯Êý¶¨ÒåÁËÄÚ²¿Àà <classname>Directory</classname>£¬Òâζ×Ų»ÄÜÔÙÓÃͬÑùµÄÃû×Ö¶¨ÒåÓû§×Ô¼ºµÄÀà¡£PHP Ô¤¶¨ÒåÀàµÄÍêÕûÁбí¼û<link linkend="reserved.classes">Ô¤¶¨ÒåÀà</link>Ò»½Ú¡£ </para> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/closedir.xml +++ phpdoc-zh/reference/dir/functions/closedir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.closedir"> <refnamediv> <refname>closedir</refname> <refpurpose>¹Ø±ÕĿ¼¾ä±ú</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>void</type><methodname>closedir</methodname> <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> </methodsynopsis> <para> ¹Ø±ÕÓÉ <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷¡£Á÷±ØÐë֮ǰ±» <function>opendir</function> Ëù´ò¿ª¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/getcwd.xml +++ phpdoc-zh/reference/dir/functions/getcwd.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.getcwd"> <refnamediv> <refname>getcwd</refname> <refpurpose>È¡µÃµ±Ç°¹¤×÷Ŀ¼</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>getcwd</methodname> <void/> </methodsynopsis> <para> ·µ»Øµ±Ç°¹¤×÷Ŀ¼¡£ </para> <para> ²Î¼û <function>chdir</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/opendir.xml +++ phpdoc-zh/reference/dir/functions/opendir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.opendir"> <refnamediv> <refname>opendir</refname> <refpurpose>´ò¿ªÄ¿Â¼¾ä±ú</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>resource</type><methodname>opendir</methodname> <methodparam><type>string</type><parameter>path</parameter></methodparam> </methodsynopsis> <para> ·µ»ØÒ»¸öĿ¼¾ä±ú£¬¿ÉÒÔÔÚÖ®ºóÓÃÔÚ <function>closedir</function>£¬<function>readdir</function> ºÍ <function>rewinddir</function> µ÷ÓÃÖС£ </para> <para> Èç¹û <parameter>path</parameter> ²»ÊÇÒ»¸öºÏ·¨µÄĿ¼»òÕßÒòΪȨÏÞÏÞÖÆ»òÎļþϵͳ´íÎó¶ø²»ÄÜ´ò¿ªÄ¿Â¼£¬<function>opendir</function> ·µ»Ø &false; ²¢²úÉúÒ»¸ö PHP ´íÎóÐÅÏ¢¡£¿ÉÒÔÔÚ <function>opendir</function> Ç°Ãæ¼ÓÉÏ¡°@¡±·ûºÅÀ´ÒÖÖÆ´íÎóÐÅÏ¢µÄÊä³ö¡£ </para> <para> <example> <title><function>opendir</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php if ($dir = @opendir("/tmp")) { while (($file = readdir($dir)) !== false) { echo "$file\n"; } closedir($dir); } ?> ]]> </programlisting> </example> </para> <para>²Î¼û <function>is_dir</function>¡£</para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/readdir.xml +++ phpdoc-zh/reference/dir/functions/readdir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.readdir"> <refnamediv> <refname>readdir</refname> <refpurpose>´ÓĿ¼¾ä±úÖжÁÈ¡ÌõÄ¿</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>readdir</methodname> <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> </methodsynopsis> <para> ·µ»ØÄ¿Â¼ÖÐÏÂÒ»¸öÎļþµÄÎļþÃû¡£ÎļþÃûÒÔÔÚÎļþϵͳÖеÄÅÅÐò·µ»Ø¡£ </para> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>readdir</function> ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹£¨ÀýÈçÒ»¸öĿ¼ÃûΪ¡°0¡±£©¡£ </para> <para> <example> <title>ÁгöĿ¼ÖеÄËùÓÐÎļþ</title> <programlisting role="php"> <![CDATA[ // ×¢ÒâÔÚ 4.0.0-RC2 ֮ǰ²»´æÔÚ !== ÔËËã·û <?php if ($handle = opendir('/path/to/files')) { echo "Directory handle: $handle\n"; echo "Files:\n"; /* ÕâÊDZéÀúĿ¼ÕýÈ·µÄ·½·¨ */ while (false !== ($file = readdir($handle))) { echo "$file\n"; } /* ÕâÊÇ´íÎ󵨱éÀúĿ¼µÄ·½·¨ */ while ($file = readdir($handle)) { echo "$file\n"; } closedir($handle); } ?> ]]> </programlisting> </example> </para> <para> ×¢Òâ <function>readdir</function> ½«»á·µ»Ø <literal>.</literal> ºÍ <literal>..</literal> ÌõÄ¿¡£Èç¹û²»ÏëÒªËüÃÇ£¬Ö»Òª¹ýÂ˵ô¼´¿É£º <example> <title> Áгöµ±Ç°Ä¿Â¼µÄËùÓÐÎļþ²¢È¥µô <literal>.</literal> ºÍ <literal>..</literal> </title> <programlisting role="php"> <![CDATA[ <?php if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file\n"; } } closedir($handle); } ?> ]]> </programlisting> </example> </para> <para>²Î¼û <function>is_dir</function>¡£</para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/rewinddir.xml +++ phpdoc-zh/reference/dir/functions/rewinddir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.rewinddir"> <refnamediv> <refname>rewinddir</refname> <refpurpose>µ¹»ØÄ¿Â¼¾ä±ú</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>void</type><methodname>rewinddir</methodname> <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> </methodsynopsis> <para> ½« <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷ÖØÖõ½Ä¿Â¼µÄ¿ªÍ·¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
Index: phpdoc-zh/reference/dir/functions/chdir.xml +++ phpdoc-zh/reference/dir/functions/chdir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.chdir"> <refnamediv> <refname>chdir</refname> <refpurpose>¸Ä±äĿ¼</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>chdir</methodname> <methodparam><type>string</type><parameter>directory</parameter></methodparam> </methodsynopsis> <para> ½« PHP µÄµ±Ç°Ä¿Â¼¸ÄΪ <parameter>directory</parameter>¡£Èç¹û²»ÄܸıäĿ¼Ôò·µ»Ø &false;£¬·ñÔò·µ»Ø &true;¡£ </para> <para> ²Î¼û <function>getcwd</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/chroot.xml +++ phpdoc-zh/reference/dir/functions/chroot.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.chroot"> <refnamediv> <refname>chroot</refname> <refpurpose>¸Ä±ä¸ùĿ¼</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>bool</type><methodname>chroot</methodname> <methodparam><type>string</type><parameter>directory</parameter></methodparam> </methodsynopsis> <para> ½«µ±Ç°½ø³ÌµÄ¸ùĿ¼¸Ä±äΪ <parameter>directory</parameter>¡£Èç¹û²»Äܸıä¸ùĿ¼Ôò·µ»Ø &false;£¬·ñÔò·µ»Ø &true;¡£ </para> <note> <para> µ±ÔËÐÐÓÚ web ·þÎñÆ÷»·¾³ÏÂʹÓô˺¯Êý²¢²»´ÏÃ÷£¬ÒòΪÔÚÇëÇó½áÊøÊ±²»¿ÉÄܽ«¸ùÄ¿Â¼ÖØÉèΪ /¡£ÕâÖÐÇé¿öϱ¾º¯Êý½öÔÚ×÷Ϊ CGI ÔËÐÐʱÄÜÕýÈ·¹¤×÷¡£ </para> </note> ¬e.no-windows; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/class.dir.xml +++ phpdoc-zh/reference/dir/functions/class.dir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="class.dir"> <refnamediv> <refname>dir</refname> <refpurpose>directory Àà</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <classsynopsis> <ooclass><classname>dir</classname></ooclass> <constructorsynopsis> <methodname>dir</methodname> <methodparam><type>string</type><parameter>directory</parameter></methodparam> </constructorsynopsis> <fieldsynopsis> <type>string</type><varname>path</varname> </fieldsynopsis> <methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis> <methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis> <methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis> </classsynopsis> <para> ÕâÊǸö·Â̡̾Ïò¶ÔÏóµÄ»úÖÆÀ´¶Áȡһ¸öĿ¼¡£¸ø¶¨µÄ <parameter>directory</parameter> ±»´ò¿ª¡£Ò»µ©Ä¿Â¼±»´ò¿ª£¬ÓÐÁ½¸öÊôÐÔ¿ÉÓá£handle ÊôÐÔ¿ÉÒÔÓÃÔÚÆäËüĿ¼º¯ÊýÀýÈç <function>readdir</function>£¬<function>rewinddir</function> ºÍ <function>closedir</function> ÖС£path ÊôÐÔ±»ÉèΪ±»´ò¿ªµÄĿ¼·¾¶¡£ÓÐÈý¸ö·½·¨¿ÉÓãºread£¬rewind ºÍ close¡£ </para> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>dir</function> ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹¡£ <example> <title><function>dir</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ $d = dir("/etc"); echo "Handle: ".$d->handle."<br>\n"; echo "Path: ".$d->path."<br>\n"; while (false !== ($entry = $d->read())) { echo $entry."<br>\n"; } $d->close(); ]]> </programlisting> </example> </para> <note> <para> read ·½·¨·µ»ØµÄĿ¼ÏîµÄ˳ÐòÒÀÀµÓÚϵͳ¡£ </para> </note> <note> <para> ±¾º¯Êý¶¨ÒåÁËÄÚ²¿Àà <classname>Directory</classname>£¬Òâζ×Ų»ÄÜÔÙÓÃͬÑùµÄÃû×Ö¶¨ÒåÓû§×Ô¼ºµÄÀà¡£PHP Ô¤¶¨ÒåÀàµÄÍêÕûÁбí¼û<link linkend="reserved.classes">Ô¤¶¨ÒåÀà</link>Ò»½Ú¡£ </para> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/closedir.xml +++ phpdoc-zh/reference/dir/functions/closedir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.closedir"> <refnamediv> <refname>closedir</refname> <refpurpose>¹Ø±ÕĿ¼¾ä±ú</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>void</type><methodname>closedir</methodname> <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> </methodsynopsis> <para> ¹Ø±ÕÓÉ <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷¡£Á÷±ØÐë֮ǰ±» <function>opendir</function> Ëù´ò¿ª¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/getcwd.xml +++ phpdoc-zh/reference/dir/functions/getcwd.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.getcwd"> <refnamediv> <refname>getcwd</refname> <refpurpose>È¡µÃµ±Ç°¹¤×÷Ŀ¼</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>getcwd</methodname> <void/> </methodsynopsis> <para> ·µ»Øµ±Ç°¹¤×÷Ŀ¼¡£ </para> <para> ²Î¼û <function>chdir</function>¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/opendir.xml +++ phpdoc-zh/reference/dir/functions/opendir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.opendir"> <refnamediv> <refname>opendir</refname> <refpurpose>´ò¿ªÄ¿Â¼¾ä±ú</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>resource</type><methodname>opendir</methodname> <methodparam><type>string</type><parameter>path</parameter></methodparam> </methodsynopsis> <para> ·µ»ØÒ»¸öĿ¼¾ä±ú£¬¿ÉÒÔÔÚÖ®ºóÓÃÔÚ <function>closedir</function>£¬<function>readdir</function> ºÍ <function>rewinddir</function> µ÷ÓÃÖС£ </para> <para> Èç¹û <parameter>path</parameter> ²»ÊÇÒ»¸öºÏ·¨µÄĿ¼»òÕßÒòΪȨÏÞÏÞÖÆ»òÎļþϵͳ´íÎó¶ø²»ÄÜ´ò¿ªÄ¿Â¼£¬<function>opendir</function> ·µ»Ø &false; ²¢²úÉúÒ»¸ö PHP ´íÎóÐÅÏ¢¡£¿ÉÒÔÔÚ <function>opendir</function> Ç°Ãæ¼ÓÉÏ¡°@¡±·ûºÅÀ´ÒÖÖÆ´íÎóÐÅÏ¢µÄÊä³ö¡£ </para> <para> <example> <title><function>opendir</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php if ($dir = @opendir("/tmp")) { while (($file = readdir($dir)) !== false) { echo "$file\n"; } closedir($dir); } ?> ]]> </programlisting> </example> </para> <para>²Î¼û <function>is_dir</function>¡£</para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/readdir.xml +++ phpdoc-zh/reference/dir/functions/readdir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.readdir"> <refnamediv> <refname>readdir</refname> <refpurpose>´ÓĿ¼¾ä±úÖжÁÈ¡ÌõÄ¿</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>readdir</methodname> <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> </methodsynopsis> <para> ·µ»ØÄ¿Â¼ÖÐÏÂÒ»¸öÎļþµÄÎļþÃû¡£ÎļþÃûÒÔÔÚÎļþϵͳÖеÄÅÅÐò·µ»Ø¡£ </para> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>readdir</function> ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹£¨ÀýÈçÒ»¸öĿ¼ÃûΪ¡°0¡±£©¡£ </para> <para> <example> <title>ÁгöĿ¼ÖеÄËùÓÐÎļþ</title> <programlisting role="php"> <![CDATA[ // ×¢ÒâÔÚ 4.0.0-RC2 ֮ǰ²»´æÔÚ !== ÔËËã·û <?php if ($handle = opendir('/path/to/files')) { echo "Directory handle: $handle\n"; echo "Files:\n"; /* ÕâÊDZéÀúĿ¼ÕýÈ·µÄ·½·¨ */ while (false !== ($file = readdir($handle))) { echo "$file\n"; } /* ÕâÊÇ´íÎ󵨱éÀúĿ¼µÄ·½·¨ */ while ($file = readdir($handle)) { echo "$file\n"; } closedir($handle); } ?> ]]> </programlisting> </example> </para> <para> ×¢Òâ <function>readdir</function> ½«»á·µ»Ø <literal>.</literal> ºÍ <literal>..</literal> ÌõÄ¿¡£Èç¹û²»ÏëÒªËüÃÇ£¬Ö»Òª¹ýÂ˵ô¼´¿É£º <example> <title> Áгöµ±Ç°Ä¿Â¼µÄËùÓÐÎļþ²¢È¥µô <literal>.</literal> ºÍ <literal>..</literal> </title> <programlisting role="php"> <![CDATA[ <?php if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file\n"; } } closedir($handle); } ?> ]]> </programlisting> </example> </para> <para>²Î¼û <function>is_dir</function>¡£</para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/dir/functions/rewinddir.xml +++ phpdoc-zh/reference/dir/functions/rewinddir.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.rewinddir"> <refnamediv> <refname>rewinddir</refname> <refpurpose>µ¹»ØÄ¿Â¼¾ä±ú</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>void</type><methodname>rewinddir</methodname> <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> </methodsynopsis> <para> ½« <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷ÖØÖõ½Ä¿Â¼µÄ¿ªÍ·¡£ </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->