cvs: phpdoc-zh /reference/filesystem/functions flock.xml fnmatch.xml fopen.xml fpassthru.xml fread.xml fscanf.xml fseek.xml fstat.xml ftell.xml
ftruncate.xml glob.xml is-executable.xml link.xml linkinfo.xml mkdir.xml parse-ini-file.xml pathinfo.xml popen.xml readlink.xml realpath.xml
rename.xml rewind.xml rmdir.xml stat.xml symlink.xml tempnam.xml tmpfile.xml touch.xml unlink.xml
| From: | Dallas Thunder | Date: | Mon, 18 Aug 2003 23:23:47 +0000 |
| Subject: | cvs: phpdoc-zh /reference/filesystem/functions flock.xml fnmatch.xml fopen.xml fpassthru.xml fread.xml fscanf.xml fseek.xml fstat.xml ftell.xml ftruncate.xml glob.xml is-executable.xml link.xml linkinfo.xml mkdir.xml parse-ini-file.xml pathinfo.xml popen.xml readlink.xml realpath.xml rename.xml rewind.xml rmdir.xml stat.xml symlink.xml tempnam.xml tmpfile.xml touch.xml unlink.xml |
||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1638@lists.php.net to get a copy of this message | ||
dallas Mon Aug 18 19:23:47 2003 EDT
Modified files:
/phpdoc-zh/reference/filesystem/functions flock.xml fnmatch.xml
fopen.xml fpassthru.xml
fread.xml fscanf.xml
fseek.xml fstat.xml
ftell.xml ftruncate.xml
glob.xml
is-executable.xml
link.xml linkinfo.xml
mkdir.xml
parse-ini-file.xml
pathinfo.xml popen.xml
readlink.xml realpath.xml
rename.xml rewind.xml
rmdir.xml stat.xml
symlink.xml tempnam.xml
tmpfile.xml touch.xml
unlink.xml
Log:
Updated.
Index: phpdoc-zh/reference/filesystem/functions/flock.xml diff -u phpdoc-zh/reference/filesystem/functions/flock.xml:1.4 phpdoc-zh/reference/filesystem/functions/flock.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/flock.xml:1.4 Mon Feb 24 10:11:26 2003 +++ phpdoc-zh/reference/filesystem/functions/flock.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: lm92 Status: ready --> +<!-- CREDITS: dallas --> <refentry id="function.flock"> <refnamediv> <refname>flock</refname> @@ -16,70 +17,93 @@ <methodparam choice="opt"><type>int</type><parameter>&wouldblock</parameter></methodparam> </methodsynopsis> <simpara> - PHP Ö§³ÖÒÔ×Éѯ·½Ê½£¨Ò²¾ÍÊÇ˵ËùÓзÃÎʳÌÐò±ØÐëʹÓÃͬÒâ·½Ê½Ëø¶¨, ·ñÔòËü²»»á¹¤×÷£©Ëø¶¨È«²¿ÎļþµÄÒ»ÖÖÇá±ã·½·¨¡£ + PHP Ö§³ÖÒÔ×Éѯ·½Ê½£¨Ò²¾ÍÊÇ˵ËùÓзÃÎʳÌÐò±ØÐëʹÓÃͬһ·½Ê½Ëø¶¨, ·ñÔòËü²»»á¹¤×÷£©Ëø¶¨È«²¿ÎļþµÄÒ»ÖÖÇá±ã·½·¨¡£ </simpara> <simpara> <function>flock</function> ²Ù×÷µÄ <parameter>handle</parameter> - ±ØÐëÊÇÒ»¸öÒѾ´ò¿ªµÄÎļþÖ¸Õë¡£ - <parameter>operation</parameter> ¿ÉÒÔÊÇÒÔÏÂÖµÖ®Ò»£º + ±ØÐëÊÇÒ»¸öÒѾ´ò¿ªµÄÎļþÖ¸Õë¡£<parameter>operation</parameter> + ¿ÉÒÔÊÇÒÔÏÂÖµÖ®Ò»£º </simpara> <para> <itemizedlist> <listitem> <simpara> - ҪȡµÃ¹²ÏíËø¶¨£¨¿É¶Á£©£¬½« - <parameter>operation</parameter> ÉèΪ <constant>LOCK_SH</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÉèÖÃΪ 1£©¡£ + ҪȡµÃ¹²ÏíËø¶¨£¨¶ÁÈ¡³ÌÐò£©£¬½« + <parameter>operation</parameter> ÉèΪ <constant>LOCK_SH</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÉèÖÃΪ 1£©¡£ </simpara> </listitem> <listitem> <simpara> - ҪȡµÃ¶ÀÕ¼Ëø¶¨£¨¿Éд£©£¬½« - <parameter>operation</parameter> ÉèΪ <constant>LOCK_EX</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 2£©¡£ + ҪȡµÃ¶ÀÕ¼Ëø¶¨£¨Ð´Èë³ÌÐò£©£¬½« + <parameter>operation</parameter> ÉèΪ <constant>LOCK_EX</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 2£©¡£ </simpara> </listitem> <listitem> <simpara> - ÒªÊÍ·ÅËø¶¨£¨ÎÞÂÛ¹²Ïí»ò¶ÀÕ¼£©£¬½« - <parameter>operation</parameter> ÉèΪ <constant>LOCK_UN</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 3£©¡£ + ÒªÊÍ·ÅËø¶¨£¨ÎÞÂÛ¹²Ïí»ò¶ÀÕ¼£©£¬½« + <parameter>operation</parameter> ÉèΪ <constant>LOCK_UN</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 3£©¡£ </simpara> </listitem> <listitem> <simpara> - Èç¹ûÄ㲻ϣÍû <function>flock</function> ÔÚËø¶¨Ê±¶ÂÈû£¬Ôò¸ø - <parameter>operation</parameter> Ôö¼Ó <constant>LOCK_NB</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 4£©¡£ + Èç¹ûÄ㲻ϣÍû <function>flock</function> ÔÚËø¶¨Ê±¶ÂÈû£¬Ôò¸ø + <parameter>operation</parameter> ¼ÓÉÏ <constant>LOCK_NB</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 4£©¡£ </simpara> </listitem> </itemizedlist> </para> <simpara> <function>flock</function> ÔÊÐíÄãÖ´ÐÐÒ»¸ö¼òµ¥µÄ¿ÉÒÔÔÚÈÎºÎÆ½Ì¨ÖÐʹÓõĶÁÈ¡/дÈëÄ£ÐÍ£¨°üÀ¨´ó²¿·ÖµÄ - Unix ÅÉÉú°æºÍÉõÖÁÊÇ Windows£©¡£Èç¹ûËø¶¨»á¶ÂÈûµÄ»°£¨EWOULDBLOCK errno condition£©£¬Ç뽫¿ÉÑ¡µÄµÚÈý¸ö²ÎÊýÉèÖÃΪ &true;¡£ + Unix ÅÉÉú°æºÍÉõÖÁÊÇ Windows£©¡£Èç¹ûËø¶¨»á¶ÂÈûµÄ»°£¨EWOULDBLOCK ´íÎóÂëÇé¿öÏ£©£¬Ç뽫¿ÉÑ¡µÄµÚÈý¸ö²ÎÊýÉèÖÃΪ &true;¡£ </simpara> <simpara> &return.success; </simpara> + <para> + <example> + <title><function>flock</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$fp = fopen("/tmp/lock.txt", "w+"); + +if (flock($fp, LOCK_EX)) { // ½øÐÐÅÅËüÐÍËø¶¨ + fwrite($fp, "Write something here\n"); + flock($fp, LOCK_UN); // ÊÍ·ÅËø¶¨ +} else { + echo "Couldn't lock the file !"; +} + +fclose($fp); + +?> +]]> + </programlisting> + </example> + </para> <note> <para> - ÓÉÓÚ <function>flock</function> ÐèÒªÒ»¸öÎļþÖ¸Õ룬 Òò´ËÄã¿ÉÄÜ - ÐèÒªÒ»¸öËø¶¨ÎļþÀ´±£»¤µ½Äã´òËãͨ¹ýдģʽ´ò¿ªÀ´½Ø¶ÏµÄÎļþµÄ·ÃÎÊ£¨ÔÚ + ÓÉÓÚ <function>flock</function> + ÐèÒªÒ»¸öÎļþÖ¸Õ룬 Òò´ËÄã¿ÉÄÜÐèÒªÒ»¸öËø¶¨ÎļþÀ´±£»¤µ½Äã´òËãͨ¹ýдģʽ´ò¿ªÀ´½Ø¶ÏµÄÎļþµÄ·ÃÎÊ£¨ÔÚ <function>fopen</function> º¯ÊýÖмÓÈë "w" »ò "w+"£©¡£ </para> </note> <warning> <para> - <function>flock</function> ²»ÄÜÔÚNFSÒÔ¼°ÆäËûµÄÒ»Ð©ÍøÂçÎļþϵͳÖÐÕý³£¹¤×÷¡£Ïêϸ×ÊÁÏÇë¼ì²éÄãµÄ²Ù×÷ϵͳÎĵµ¡£ + <function>flock</function> ²»ÄÜÔÚ NFS + ÒÔ¼°ÆäËûµÄÒ»Ð©ÍøÂçÎļþϵͳÖÐÕý³£¹¤×÷¡£Ïêϸ×ÊÁÏÇë¼ì²éÄãµÄ²Ù×÷ϵͳÎĵµ¡£ </para> <para> - ÔÚ²¿·Ö²Ù×÷ϵͳÖУ¬ <function>flock</function> ÒÔ´¦Àí¼¶Ö´ÐС£ - µ±ÓÃÒ»¸ö¶àÏ̷߳þÎñÆ÷ API£¨±ÈÈç ISAPI£©Ê±£¬ - Äú¿ÉÄܲ»¿ÉÒÔÒÀ¿¿ <function>flock</function> À´±£»¤Îļþ£¬ - ÒòΪÔÚͬһ·þÎñÆ÷ÄÚÔËÐÐÔÚÆäËü³ÌÏßµÄPHP½Å±¾¿ÉÒÔ¶Ô¸ÃÎļþ½øÐд¦Àí¡£ - instance! + ÔÚ²¿·Ö²Ù×÷ϵͳÖУ¬<function>flock</function> ÒÔ´¦Àí¼¶Ö´ÐС£µ±ÓÃÒ»¸ö¶àÏ̷߳þÎñÆ÷ + API£¨±ÈÈç ISAPI£©Ê±£¬Äú¿ÉÄܲ»¿ÉÒÔÒÀ¿¿ + <function>flock</function> À´±£»¤Îļþ£¬ÒòΪÔÚͬһ·þÎñÆ÷ÄÚÔËÐÐÔÚÆäËüÏß³ÌµÄ + PHP ½Å±¾¿ÉÒÔ¶Ô¸ÃÎļþ½øÐд¦Àí¡£ </para> <para> - <function>flock</function> ²»Ö§³Ö¾ÉµÄÎļþϵͳ£¬Èç - <literal>FAT</literal> ÒÔ¼°ËüµÄÅÉÉúϵͳ¡£Òò´Ë£¬ËüÔÚÕâÖÖÇé¿öϾ³£»á·µ»Ø - Ò»¸ö &false; Öµ£¨ÓÈÆäÊÇÖ¸Windows 98µÄÓû§£©¡£ + <function>flock</function> ²»Ö§³Ö¾ÉµÄÎļþϵͳ£¬Èç <literal>FAT</literal> + ÒÔ¼°ËüµÄÅÉÉúϵͳ¡£Òò´Ë£¬ËüÔÚÕâÖÖÇé¿öϾ³£»á·µ»ØÒ»¸ö &false; + Öµ£¨ÓÈÆäÊÇÖ¸ Windows 98 µÄÓû§£©¡£ </para> </warning> </refsect1> Index: phpdoc-zh/reference/filesystem/functions/fnmatch.xml diff -u phpdoc-zh/reference/filesystem/functions/fnmatch.xml:1.2 phpdoc-zh/reference/filesystem/functions/fnmatch.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/fnmatch.xml:1.2 Fri Feb 28 04:30:51 2003 +++ phpdoc-zh/reference/filesystem/functions/fnmatch.xml Mon Aug 18 19:23:46 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.fnmatch"> <refnamediv> - <refname>fnmatch</refname> + <refname>fnmatch</refname> <refpurpose>ÓÃģʽƥÅäÎļþÃû</refpurpose> </refnamediv> <refsect1> @@ -38,9 +38,11 @@ </title> <programlisting role="php"> <![CDATA[ +<?php if(fnmatch("*gr[ae]y", $color)) { echo "some form of gray ..."; } +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/fopen.xml diff -u phpdoc-zh/reference/filesystem/functions/fopen.xml:1.5 phpdoc-zh/reference/filesystem/functions/fopen.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/fopen.xml:1.5 Sun Apr 20 02:35:00 2003 +++ phpdoc-zh/reference/filesystem/functions/fopen.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.18 Maintainer: dallas Status: ready --> <!-- CREDITS: lm92 --> <refentry id="function.fopen"> <refnamediv> @@ -49,9 +49,9 @@ <simpara> ËùÖ§³ÖµÄÐÒéÁбí¼û<xref linkend="wrappers"/>¡£Ä³Ð©ÐÒ飨Ҳ±»³ÆÎª <literal>wrappers</literal>£©Ö§³Ö - <literal>context</literal> ºÍ <literal>php.ini</literal> + <literal>context</literal> ºÍ &php.ini; Ñ¡Ïî¡£²Î¼ûÏàÓ¦µÄÒ³ÃæÄÄЩѡÏî¿ÉÒÔ±»É趨¡££¨Ò²¾ÍÊÇ - <literal>php.ini</literal> µÄÖµ + &php.ini; µÄÖµ <literal>user_agent</literal> ÓÃÔÚ <literal>http</literal> ÐÒéÖС££©ÓÐ¹Ø <literal>contexts</literal> ºÍ <parameter>zcontext</parameter> ²ÎÊýµÄ˵Ã÷£¬²Î¼û <xref linkend="ref.stream"/>¡£ @@ -109,16 +109,80 @@ ¶Áд·½Ê½´ò¿ª£¬½«ÎļþÖ¸ÕëÖ¸ÏòÎļþĩβ¡£Èç¹ûÎļþ²»´æÔÚÔò³¢ÊÔ´´½¨Ö®¡£ </entry> </row> + <row> + <entry><literal>'x'</literal></entry> + <entry> + ´´½¨²¢ÒÔдÈ뷽ʽ´ò¿ª£¬½«ÎļþÖ¸ÕëÖ¸ÏòÎļþÍ·¡£Èç¹ûÎļþÒÑ´æÔÚ£¬Ôò + <function>fopen</function> µ÷ÓÃʧ°Ü²¢·µ»Ø &false;£¬²¢Éú³ÉÒ»Ìõ + <constant>E_WARNING</constant> ¼¶±ðµÄ´íÎóÐÅÏ¢¡£Èç¹ûÎļþ²»´æÔÚÔò³¢ÊÔ´´½¨Ö®¡£ÕâºÍ¸ø + µ×²ãµÄ <literal>open(2)</literal> ϵͳµ÷ÓÃÖ¸¶¨ + <literal>O_EXCL|O_CREAT</literal> ±ê¼ÇÊǵȼ۵ġ£´ËÑ¡Ïî±» + PHP 4.3.2 ÒÔ¼°ÒÔºóµÄ°æ±¾ËùÖ§³Ö£¬½öÄÜÓÃÓÚ±¾µØÎļþ¡£ + </entry> + </row> + <row> + <entry><literal>'x+'</literal></entry> + <entry> + ´´½¨²¢ÒÔ¶Áд·½Ê½´ò¿ª£¬½«ÎļþÖ¸ÕëÖ¸ÏòÎļþÍ·¡£Èç¹ûÎļþÒÑ´æÔÚ£¬Ôò + <function>fopen</function> µ÷ÓÃʧ°Ü²¢·µ»Ø &false;£¬²¢Éú³ÉÒ»Ìõ + <constant>E_WARNING</constant> ¼¶±ðµÄ´íÎóÐÅÏ¢¡£Èç¹ûÎļþ²»´æÔÚÔò³¢ÊÔ´´½¨Ö®¡£ÕâºÍ¸ø + µ×²ãµÄ <literal>open(2)</literal> ϵͳµ÷ÓÃÖ¸¶¨ + <literal>O_EXCL|O_CREAT</literal> ±ê¼ÇÊǵȼ۵ġ£´ËÑ¡Ïî±» + PHP 4.3.2 ÒÔ¼°ÒÔºóµÄ°æ±¾ËùÖ§³Ö£¬½öÄÜÓÃÓÚ±¾µØÎļþ¡£ + </entry> + </row> </tbody> </tgroup> </table> </para> <note> <para> - <parameter>mode</parameter> ¿ÉÒÔ°üÀ¨×Öĸ - 'b'£¬½öÔÚÇø·Ö¶þ½øÖƺÍÎı¾ÎļþµÄϵͳÏÂÓÐÓã¨ÀýÈç - Windows¡£ÔÚ UNIX ÏÂûÓÐÓã©¡£Èç¹û²»ÐèÒª½«±»ºöÂÔ¡£¹ÄÀøÓû§°üÀ¨ - 'b' ±ê¼ÇÒÔʹ½Å±¾¾ßÓиüºÃµÄÒÆÖ²ÐÔ¡£ + ²»Í¬µÄ²Ù×÷ϵͳ¼Ò×å¾ßÓв»Í¬µÄÐнáÊøÏ°¹ß¡£µ±ÄãдÈëÒ»¸öÎı¾Îļþ²¢Ïë²åÈëÒ»¸öÐÂÐÐʱ£¬ÄãÐèҪʹÓ÷ûºÏÄã²Ù×÷ϵͳµÄÐнáÊø·ûºÅ¡£»ùÓÚ + Unix µÄϵͳʹÓà <literal>\n</literal> + ×÷ΪÐнáÊø×Ö·û£¬»ùÓÚ Windows µÄϵͳʹÓà <literal>\r\n</literal> + ×÷ΪÐнáÊø×Ö·û£¬»ùÓÚ Macintosh µÄϵͳʹÓà <literal>\r</literal> + ×÷ΪÐнáÊø×Ö·û¡£ + </para> + <para> + Èç¹ûдÈëÎļþʱʹÓÃÁË´íÎóµÄÐнáÊø·ûºÅ£¬ÔòÆäËüÓ¦ÓóÌÐò´ò¿ªÕâЩÎļþʱ¿ÉÄÜ»á±íÏֵúܹÖÒì¡£ + </para> + <para> + Windows ÏÂÌṩÁËÒ»¸öÎı¾×ª»»±ê¼Ç£¨<literal>'t'</literal>£©¿ÉÒÔ͸Ã÷µØ½« + <literal>\n</literal> ת»»Îª <literal>\r\n</literal>¡£Óë´Ë¶ÔÓ¦Ä㻹¿ÉÒÔʹÓà + <literal>'b'</literal> À´Ç¿ÖÆÊ¹Óöþ½øÖÆÄ£Ê½£¬ÕâÑù¾Í²»»áת»»ÄãµÄÊý¾Ý¡£ÒªÊ¹ÓÃÕâЩ±ê¼Ç£¬ÒªÃ´Óà + <literal>'b'</literal> »òÕßÓà <literal>'t'</literal> ×÷Ϊ + <parameter>mode</parameter> ²ÎÊýµÄ×îºóÒ»¸ö×Ö·û¡£ + </para> + <para> + ĬÈϵÄת»»Ä£Ê½ÒÀÀµÓÚ SAPI ºÍÄãʹÓÃµÄ PHP + °æ±¾£¬Òò´ËΪÁ˱ãÓÚÒÆÖ²¹ÄÀøÄã×ÜÊÇÖ¸¶¨Ç¡µ±µÄ±ê¼Ç¡£µ±²Ù×÷ÒÔ + <literal>\n</literal> ×÷ΪÐнáÊø¶¨½ç·ûµÄ´¿Îı¾Îļþʱ£¬Èç¹ûÄ㻹ÆÚÍûÕâЩÎļþ¿ÉÒÔÓÃÓÚÆäËüÓ¦ÓóÌÐòÀýÈç + Notepad£¬ÔòÓ¦¸ÃÔڽű¾ÖÐʹÓà <literal>'t'</literal> + ģʽ¡£ÔÚËùÓÐÆäËüÇé¿öÏÂʹÓà <literal>'b'</literal>¡£ + </para> + <para> + ÔÚ²Ù×÷¶þ½øÖÆÎļþʱÈç¹ûûÓÐÖ¸¶¨ <literal>'b'</literal> + ±ê¼Ç£¬¿ÉÄÜ»áÅöµ½Ò»Ð©Ææ¹ÖµÄÎÊÌ⣬°üÀ¨»µµôµÄͼƬÎļþÒÔ¼°¹ØÓÚ + <literal>\r\n</literal> ×Ö·ûµÄÆæ¹ÖÎÊÌâ¡£ + </para> + <para> + <emphasis> + ÎªÒÆÖ²ÐÔ¿¼ÂÇ£¬Ç¿ÁÒ½¨ÒéÔÚÓà <function>fopen</function> + ´ò¿ªÎļþʱ×ÜÊÇʹÓà <literal>'b'</literal> ±ê¼Ç¡£ + </emphasis> + </para> + <para> + <emphasis> + ÔÙÒ»´Î£¬ÎªÒÆÖ²ÐÔ¿¼ÂÇ£¬Ç¿ÁÒ½¨ÒéÄãÖØÐ´ÄÇЩÒÀÀµÓÚ + <literal>'t'</literal> ģʽµÄ´úÂëʹÆäʹÓÃÕýÈ·µÄÐнáÊø·û²¢¸Ä³É + <literal>'b'</literal> ģʽ¡£ + </emphasis> + </para> + <para> + <emphasis> + ×Ô PHP 4.3.2 Æð£¬¶ÔËùÓÐÇø±ð¶þ½øÖƺÍÎı¾Ä£Ê½µÄƽ̨ĬÈÏģʽ¶¼±»ÉèΪ¶þ½øÖÆÄ£Ê½¡£Èç¹ûÄãÔÚÉý¼¶ºó½Å±¾Åöµ½ÎÊÌ⣬³¢ÊÔÔÝʱʹÓà + <literal>'t'</literal> ±ê¼Ç£¬Ö±µ½ËùÓеĽű¾¶¼ÕÕÒÔÉÏËù˵µÄ¸ÄΪ¸ü¾ßÒÆÖ²ÐÔÒÔºó¡£ + </emphasis> </para> </note> <para> @@ -153,7 +217,7 @@ <para> ÔÚ Windows ƽ̨ÉÏ£¬ÒªÐ¡ÐÄתÒåÎļþ·¾¶ÖеÄÿ¸ö·´Ð±Ïߣ¬»òÕßÓÃбÏß¡£ <informalexample> - <programlisting role="php"> + <programlisting role="php"> <![CDATA[ <?php $handle = fopen ("c:\\data\\info.txt", "r"); @@ -163,7 +227,7 @@ </informalexample> </para> <simpara> - ²Î¼û<xref linkend="wrappers"/>£¬<function>fclose</function>£¬<function>fgets</function>£¬<function>fsockopen</function>£¬<function>file</function>£¬<function>file_exists</function>£¬<function>is_readable</function>£¬<function>socket_set_timeout</function> + ²Î¼û<xref linkend="wrappers"/>£¬<function>fclose</function>£¬<function>fgets</function>£¬<function>fread</function>£¬<function>fwrite</function>£¬<function>fsockopen</function>£¬<function>file</function>£¬<function>file_exists</function>£¬<function>is_readable</function>£¬<function>stream_set_timeout</function> ºÍ <function>popen</function>¡£ </simpara> </refsect1> Index: phpdoc-zh/reference/filesystem/functions/fpassthru.xml diff -u phpdoc-zh/reference/filesystem/functions/fpassthru.xml:1.5 phpdoc-zh/reference/filesystem/functions/fpassthru.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/fpassthru.xml:1.5 Fri Feb 28 04:30:51 2003 +++ phpdoc-zh/reference/filesystem/functions/fpassthru.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <!-- CREDITS: lm92 --> <refentry id="function.fpassthru"> <refnamediv> @@ -10,10 +10,10 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>fpassthru</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>int</type><methodname>fpassthru</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + </methodsynopsis> <simpara> ½«¸ø¶¨µÄÎļþÖ¸Õë´Óµ±Ç°µÄλÖöÁÈ¡µ½ EOF ²¢°Ñ½á¹ûдµ½Êä³ö»º³åÇø¡£ </simpara> @@ -50,6 +50,30 @@ ±êÖ¾£¬¼´Ê¹ÏµÍ³²¢²»ÐèÒª£¬ÕâÑù¿ÉÒÔʹ½Å±¾µÄÒÆÖ²ÐÔ¸üºÃ¡£ </para> </note> + <para> + <example> + <title>¶Ô¶þ½øÖÆÎļþʹÓà <function>fpassthru</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +// open the file in a binary mode +$name = ".\public\dev\img\ok.png"; +$fp = fopen($name, 'rb'); + +// send the right headers +header("Content-Type: image/png"); +header("Content-Length: ".filesize($name)); + +// dump the picture and stop the script +fpassthru($fp); +exit; + +?> +]]> + </programlisting> + </example> + </para> <simpara> ²Î¼û <function>readfile</function>£¬<function>fopen</function>£¬<function>popen</function> Index: phpdoc-zh/reference/filesystem/functions/fread.xml diff -u phpdoc-zh/reference/filesystem/functions/fread.xml:1.4 phpdoc-zh/reference/filesystem/functions/fread.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/fread.xml:1.4 Fri Feb 28 03:22:08 2003 +++ phpdoc-zh/reference/filesystem/functions/fread.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.14 Maintainer: lm92 Status: ready --> +<!-- CREDITS: dallas --> <refentry id="function.fread"> <refnamediv> <refname>fread</refname> @@ -19,9 +20,9 @@ <parameter>handle</parameter> ¶ÁÈ¡×î¶à <parameter>length</parameter> ¸ö×Ö½Ú¡£ ¸Ãº¯ÊýÔÚ¶ÁÈ¡Íê - <parameter>length</parameter> ¸ö×Ö½ÚÊý»òµ½´ï - EOF µÄʱºò¾Í»áÍ£Ö¹¶ÁÈ¡Îļþ£¬ÊÓºõÏÈÅöµ½ÄÄÖÖÇé¿ö¡£ - </simpara> + <parameter>length</parameter> ¸ö×Ö½ÚÊý£¬»òµ½´ï + EOF µÄʱºò£¬»ò£¨¶ÔÓÚÍøÂçÁ÷£©µ±Ò»¸ö°ü¿ÉÓÃʱ¾Í»áÍ£Ö¹¶ÁÈ¡Îļþ£¬ÊÓºõÏÈÅöµ½ÄÄÖÖÇé¿ö¡£ + </simpara> <para> <informalexample> <programlisting role="php"> @@ -35,12 +36,12 @@ </programlisting> </informalexample> </para> - <note> + <warning> <para> - ÔÚÇø·Ö¶þ½øÖÆÎļþºÍÎı¾ÎļþµÄϵͳÉÏ£¨Èç Windows£© - ´ò¿ªÎļþʱ£¬<function>fopen</function> º¯ÊýµÄ mode ²ÎÊýÒª¼ÓÉÏ 'b'¡£ + ÔÚÇø·Ö¶þ½øÖÆÎļþºÍÎı¾ÎļþµÄϵͳÉÏ£¨Èç + Windows£©´ò¿ªÎļþʱ£¬<function>fopen</function> º¯ÊýµÄ mode ²ÎÊýÒª¼ÓÉÏ 'b'¡£ </para> - </note> + </warning> <para> <informalexample> <programlisting role="php"> @@ -53,10 +54,50 @@ </programlisting> </informalexample> </para> + <warning> + <para> + µ±´ÓÍøÂçÁ÷»òÕ߹ܵÀ¶Áȡʱ£¬ÀýÈçÔÚ¶ÁÈ¡´Ó<link + linkend="features.remote-files">Ô¶³ÌÎļþ</link>»ò + <function>popen</function> ÒÔ¼° <function>proc_open</function> + µÄ·µ»ØÊ±£¬¶ÁÈ¡»áÔÚÒ»¸ö°ü¿ÉÓÃÖ®ºóÍ£Ö¹¡£ÕâÒâζ×ÅÄãÓ¦¸ÃÈçÏÂÀýËùʾ½«Êý¾ÝÊÕ¼¯ÆðÀ´ºÏ²¢³É´ó¿é¡£ + </para> + </warning> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$handle = fopen ("http://www.example.com/", "rb"); +$contents = ""; +do { + $data = fread($handle, 8192); + if (strlen($data) == 0) { + break; + } + $contents .= $data; +} while(true); +fclose ($handle); +?> +]]> + </programlisting> + </informalexample> + </para> + <note> + <para> + ÉÏÀý±È´«Í³µÄʹÓà while(!<function>feof</function>) + µÄ·½·¨ÐÔÄÜÒªºÃ£¬ÒòΪÔÚÿ¸öÑ»·ÖнÚÔ¼Á˺¯Êýµ÷Óõύ·Ñ¡£ + </para> + </note> + <note> + <para> + Èç¹ûÄãÖ»ÊÇÏ뽫һ¸öÎļþµÄÄÚÈݶÁÈëµ½Ò»¸ö×Ö·û´®ÖУ¬Óà + <function>file_get_contents</function>£¬ËüµÄÐÔÄܱÈÉÏÃæµÄ´úÂëºÃµÃ¶à¡£ + </para> + </note> <simpara> ²Î¼û - <function>fwrite</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function>£¬<function>fgets</function>£¬<function>fgetss</function>£¬<function>fscanf</function>£¬<function>file</function> ºÍ - <function>fpassthru</function>¡£ + <function>fwrite</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function>£¬<function>fgets</function>£¬<function>fgetss</function>£¬<function>fscanf</function>£¬<function>file</function> + ºÍ <function>fpassthru</function>¡£ </simpara> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/fscanf.xml diff -u phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.2 phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.2 Fri Apr 11 12:18:46 2003 +++ phpdoc-zh/reference/filesystem/functions/fscanf.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.fscanf"> <refnamediv> <refname>fscanf</refname> @@ -31,25 +31,27 @@ <title><function>fscanf</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $handle = fopen ("users.txt","r"); while ($userinfo = fscanf ($handle, "%s\t%s\t%s\n")) { list ($name, $profession, $countrycode) = $userinfo; //... do something with the values } fclose($handle); +?> ]]> </programlisting> </example> <example> <title>users.txt</title> - <programlisting> + <screen> <![CDATA[ javier argonaut pe hiroshi sculptor jp robert slacker us luigi florist it ]]> - </programlisting> + </screen> </example> </para> <note> Index: phpdoc-zh/reference/filesystem/functions/fseek.xml diff -u phpdoc-zh/reference/filesystem/functions/fseek.xml:1.2 phpdoc-zh/reference/filesystem/functions/fseek.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/fseek.xml:1.2 Fri Apr 11 12:18:47 2003 +++ phpdoc-zh/reference/filesystem/functions/fseek.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> @@ -9,12 +9,12 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>fseek</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - <methodparam><type>int</type><parameter>offset</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>int</type><methodname>fseek</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + <methodparam><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> + </methodsynopsis> <para> ÔÚÓë <parameter>handle</parameter> @@ -37,7 +37,28 @@ <constant>SEEK_SET</constant>¡£ </para> <para> - ³É¹¦·µ»Ø 0£»·ñÔò·µ»Ø -1¡£×¢ÒâÒÆ¶¯µ½ EOF Ö®ºóµÄλÖò»Ëã´íÎó¡£ + ³É¹¦Ôò·µ»Ø 0£»·ñÔò·µ»Ø -1¡£×¢ÒâÒÆ¶¯µ½ EOF Ö®ºóµÄλÖò»Ëã´íÎó¡£ + </para> + <para> + <example> + <title><function>fseek</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$fp = fopen('somefile.txt'); + +// read some data +$data = fgets($fp, 4096); + +// move back to the begining of the file +// same as rewind($fp); +fseek($fp, 0); + +?> +]]> + </programlisting> + </example> </para> <para> ¿ÉÄܲ»ÄÜÓÃÓÚÔÚ Index: phpdoc-zh/reference/filesystem/functions/fstat.xml diff -u phpdoc-zh/reference/filesystem/functions/fstat.xml:1.3 phpdoc-zh/reference/filesystem/functions/fstat.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/fstat.xml:1.3 Wed Apr 23 19:11:11 2003 +++ phpdoc-zh/reference/filesystem/functions/fstat.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> <refentry id="function.fstat"> <refnamediv> <refname>fstat</refname> @@ -9,36 +9,69 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>array</type><methodname>fstat</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>array</type><methodname>fstat</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + </methodsynopsis> <para> »ñÈ¡ÓÉÎļþÖ¸Õë <parameter>handle</parameter> Ëù´ò¿ªÎļþµÄͳ¼ÆÐÅÏ¢¡£±¾º¯ÊýºÍ <function>stat</function> º¯ÊýÏàËÆ£¬³ýÁËËüÊÇ×÷ÓÃÓÚÒÑ´ò¿ªµÄÎļþÖ¸Õë¶ø²»ÊÇÎļþÃû¡£ </para> <para> - ·µ»ØÒ»¸öÊý×é°üº¬ÓÐÎļþµÄͳ¼ÆÐÅÏ¢¡£¸ÃÊý×é¾ßÓÐÒÔϵ¥Ôª£º - <orderedlist> - <listitem><simpara>device - É豸Ãû</simpara></listitem> - <listitem><simpara>inode - ½ÚµãÃû</simpara></listitem> - <listitem><simpara>number of links - Á¬½ÓÊýÄ¿</simpara></listitem> - <listitem><simpara>user id of owner - ËùÓÐÕßµÄÓû§ id</simpara></listitem> - <listitem><simpara>group id owner - ËùÓÐÕßµÄ×é id</simpara></listitem> - <listitem><simpara>device type if inode device *</simpara></listitem> - <listitem><simpara>size in bytes - Îļþ´óСµÄ×Ö½ÚÊý</simpara></listitem> - <listitem><simpara>time of last access - ÉÏÒ»´Î±»·ÃÎÊʱ¼ä</simpara></listitem> - <listitem><simpara>time of last modification - ÉÏÒ»´Î±»ÐÞ¸Äʱ¼ä</simpara></listitem> - <listitem><simpara>time of last change - ÉÏÒ»´Î¸Ä±äʱ¼ä</simpara></listitem> - <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> - <listitem><simpara>number of blocks allocated - Ëù·ÖÅä¿éµÄÊýÄ¿</simpara></listitem> - </orderedlist> - * - ½öÔÚÖ§³Ö st_blksize ÀàÐ͵ÄϵͳÏÂÓÐЧ¡£ÆäËüϵͳ£¨Èç Windows£©·µ»Ø -1¡£ + ·µ»ØÒ»¸öÊý×é¾ßÓиÃÎļþµÄͳ¼ÆÐÅÏ¢£¬¸ÃÊý×éµÄ¸ñʽÏêϸ˵Ã÷ÓÚÊÖ²áÖÐ + <function>stat</function> Ò³ÃæÀï¡£ </para> - + <para> + <example> + <title><function>fstat</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// ´ò¿ªÎļþ +$fp = fopen("/etc/passwd", "r"); + +// È¡µÃͳ¼ÆÐÅÏ¢ +$fstat = fstat($fp); + +// ¹Ø±ÕÎļþ +fclose($fp); + +// Ö»ÏÔʾ¹ØÁªÊý×鲿·Ö +print_r(array_slice($fstat, 13)); + +?> +]]> + </programlisting> + <para> + Êä³öÀàËÆÓÚ£º + </para> + <screen> +<![CDATA[ +Array +( + [dev] => 771 + [ino] => 488704 + [mode] => 33188 + [nlink] => 1 + [uid] => 0 + [gid] => 0 + [rdev] => 0 + [size] => 1114 + [atime] => 1061067181 + [mtime] => 1056136526 + [ctime] => 1056136526 + [blksize] => 4096 + [blocks] => 8 +) +]]> + </screen> + </example> + </para> + ¬e.clearstatcache; - + ¬e.no-remote; </refsect1> Index: phpdoc-zh/reference/filesystem/functions/ftell.xml diff -u phpdoc-zh/reference/filesystem/functions/ftell.xml:1.3 phpdoc-zh/reference/filesystem/functions/ftell.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/ftell.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/ftell.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.ftell"> <refnamediv> <refname>ftell</refname> @@ -23,7 +23,28 @@ ÎļþÖ¸Õë±ØÐëÊÇÓÐЧµÄ£¬ÇÒ±ØÐëÖ¸ÏòÒ»¸öͨ¹ý <function>fopen</function> »ò <function>popen</function> ³É¹¦´ò¿ªµÄÎļþ¡£ </para> - <para> + <para> + <example> + <title><function>ftell</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// ´ò¿ªÎļþ²¢¶ÁЩÊý¾Ý +$fp = fopen("/etc/passwd", "r"); +$data = fgets($fp, 12); + +// ÏÖÔÚÖ¸Õëµ½ÄÄÀïÁË£¿ +echo ftell($fp); // 11 + +fclose($fp); + +?> +]]> + </programlisting> + </example> + </para> + <para> ²Î¼û <function>fopen</function>£¬<function>popen</function>£¬<function>fseek</function> ºÍ <function>rewind</function>¡£ Index: phpdoc-zh/reference/filesystem/functions/ftruncate.xml diff -u phpdoc-zh/reference/filesystem/functions/ftruncate.xml:1.3 phpdoc-zh/reference/filesystem/functions/ftruncate.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/ftruncate.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/ftruncate.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.ftruncate"> <refnamediv> <refname>ftruncate</refname> @@ -17,6 +17,16 @@ <para> ½ÓÊÜÎļþÖ¸Õë <parameter>handle</parameter> ×÷Ϊ²ÎÊý£¬²¢½«Îļþ´óС½ØÈ¡Îª <parameter>size</parameter>¡£&return.success; + </para> + <note> + <para> + ÔÚ PHP 4.3.3 ֮ǰ£¬<function>ftruncate</function> Ôڳɹ¦Ê±·µ»ØÒ»¸ö + <type>integer</type> Öµ 1£¬¶ø²»ÊÇ <type>boolean</type> µÄ &true;¡£ + </para> + </note> + <para> + ²Î¼û <function>fopen</function> + ºÍ <function>fseek</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/glob.xml diff -u phpdoc-zh/reference/filesystem/functions/glob.xml:1.3 phpdoc-zh/reference/filesystem/functions/glob.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/glob.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/glob.xml Mon Aug 18 19:23:46 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> <refentry id="function.glob"> <refnamediv> - <refname>glob</refname> + <refname>glob</refname> <refpurpose>ѰÕÒÓëģʽƥÅäµÄÎļþ·¾¶</refpurpose> </refnamediv> <refsect1> @@ -58,7 +58,8 @@ </para> <note> <simpara> - <constant>GLOB_ONLYDIR</constant> ²»¿ÉÓÃÓÚ Windows Ï¡£ + ÔÚ PHP 4.3.3 ֮ǰ£¬<constant>GLOB_ONLYDIR</constant> + <emphasis role="strong">²»¿É</emphasis>ÓÃÓÚ Windows ÏÂÒÔ¼°ÆäËü²»Ê¹Óà GNU C ¿âµÄϵͳ¡£ </simpara> </note> <para> @@ -85,9 +86,9 @@ </programlisting> </example> </para> - + ¬e.no-remote; - + <para> ²Î¼û <function>opendir</function>£¬<function>readdir</function>£¬<function>closedir</function> Index: phpdoc-zh/reference/filesystem/functions/is-executable.xml diff -u phpdoc-zh/reference/filesystem/functions/is-executable.xml:1.3 phpdoc-zh/reference/filesystem/functions/is-executable.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/is-executable.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/is-executable.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> <refentry id="function.is-executable"> <refnamediv> <refname>is_executable</refname> @@ -16,16 +16,37 @@ <para> Èç¹ûÎļþ´æÔÚÇÒ¿ÉÖ´ÐÐÔò·µ»Ø &true;¡£ </para> - - ¬e.no-windows; - + <para> + <function>is_executable</function> ×Ô PHP 5.0.0 °æÆð¿ÉÓÃÓÚ Windows¡£ + </para> + <para> + <example> + <title><function>is_executable</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$file = '/home/vincent/somefile.sh'; + +if(is_executable($file)) { + echo $file.' is executable'; +} else { + echo $file.' is not executable'; +} + +?> +]]> + </programlisting> + </example> + </para> + ¬e.clearstatcache; ¬e.no-remote; <para> - ²Î¼û <function>is_file</function> ºÍ - <function>is_link</function>¡£ + ²Î¼û <function>is_file</function> + ºÍ <function>is_link</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/link.xml diff -u phpdoc-zh/reference/filesystem/functions/link.xml:1.3 phpdoc-zh/reference/filesystem/functions/link.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/link.xml:1.3 Wed Apr 23 20:07:31 2003 +++ phpdoc-zh/reference/filesystem/functions/link.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.link"> <refnamediv> <refname>link</refname> @@ -10,14 +10,14 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>link</methodname> + <type>bool</type><methodname>link</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>string</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> - <function>link</function> ½¨Á¢Ò»¸öÓ²Á¬½Ó¡£ + <function>link</function> ½¨Á¢Ò»¸öÓ²Á¬½Ó¡£&return.success; </para> - + ¬e.no-remote; <para> Index: phpdoc-zh/reference/filesystem/functions/linkinfo.xml diff -u phpdoc-zh/reference/filesystem/functions/linkinfo.xml:1.3 phpdoc-zh/reference/filesystem/functions/linkinfo.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/linkinfo.xml:1.3 Wed Apr 23 20:07:31 2003 +++ phpdoc-zh/reference/filesystem/functions/linkinfo.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.linkinfo"> <refnamediv> <refname>linkinfo</refname> @@ -19,6 +19,20 @@ ×ֶΡ£±¾º¯ÊýÓÃÀ´ÑéÖ¤Ò»¸öÁ¬½Ó£¨ÓÉ <parameter>path</parameter> ËùÖ¸ÏòµÄ£©ÊÇ·ñȷʵ´æÔÚ£¨Ê¹Óà stat.h ÖÐµÄ S_ISLNK ºêͬÑùµÄ·½·¨£©¡£Èç¹û³ö´íÔò·µ»Ø 0 »ò &false;¡£ + </para> + <para> + <example> + <title><function>linkinfo</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo linkinfo('/vmlinuz'); // 835 + +?> +]]> + </programlisting> + </example> </para> <para> ²Î¼û Index: phpdoc-zh/reference/filesystem/functions/mkdir.xml diff -u phpdoc-zh/reference/filesystem/functions/mkdir.xml:1.3 phpdoc-zh/reference/filesystem/functions/mkdir.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/mkdir.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/mkdir.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.mkdir"> <refnamediv> <refname>mkdir</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>mkdir</methodname> + <type>bool</type><methodname>mkdir</methodname> <methodparam><type>string</type><parameter>pathname</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> </methodsynopsis> @@ -34,7 +34,9 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php mkdir ("/path/to/my/dir", 0700); +?> ]]> </programlisting> </informalexample> Index: phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml diff -u phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml:1.3 phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.14 Maintainer: dallas Status: ready --> <refentry id="function.parse-ini-file"> <refnamediv> <refname>parse_ini_file</refname> @@ -41,7 +41,7 @@ </note> <note> <simpara> - ÓÐЩ±£Áô×Ö²»ÄÜ×÷Ϊ ini ÎļþÖеļüÃû£¬°üÀ¨£ºyes£¬no£¬true ºÍ false¡£ + ÓÐЩ±£Áô×Ö²»ÄÜ×÷Ϊ ini ÎļþÖеļüÃû£¬°üÀ¨£ºnull£¬yes£¬no£¬true ºÍ false¡£ </simpara> </note> <para> @@ -93,12 +93,10 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - Would produce: - <informalexample> - <programlisting> + <para> + ½«Êä³ö£º + </para> + <screen> <![CDATA[ Array ( @@ -125,8 +123,8 @@ ) ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/pathinfo.xml diff -u phpdoc-zh/reference/filesystem/functions/pathinfo.xml:1.3 phpdoc-zh/reference/filesystem/functions/pathinfo.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/pathinfo.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/pathinfo.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> @@ -34,19 +34,17 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - ½«Êä³ö£º - <informalexample> - <programlisting> + <para> + ½«Êä³ö£º + </para> + <screen> <![CDATA[ /www/htdocs index.html html ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> <note> <para> Index: phpdoc-zh/reference/filesystem/functions/popen.xml diff -u phpdoc-zh/reference/filesystem/functions/popen.xml:1.3 phpdoc-zh/reference/filesystem/functions/popen.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/popen.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/popen.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.popen"> <refnamediv> <refname>popen</refname> @@ -14,10 +14,10 @@ <methodparam><type>string</type><parameter>command</parameter></methodparam> <methodparam><type>string</type><parameter>mode</parameter></methodparam> </methodsynopsis> - <para> + <para> ´ò¿ªÒ»¸öÖ¸Ïò½ø³ÌµÄ¹ÜµÀ£¬¸Ã½ø³ÌÓÉÅÉÉú¸ø¶¨µÄ <parameter>command</parameter> ÃüÁîÖ´Ðжø²úÉú¡£ </para> - <para> + <para> ·µ»ØÒ»¸öºÍ <function>fopen</function> Ëù·µ»ØµÄÏàͬµÄÎļþÖ¸Õ룬ֻ²»¹ýËüÊǵ¥ÏòµÄ£¨Ö»ÄÜÓÃÓÚ¶Á»òд£©²¢ÇÒ±ØÐëÓà <function>pclose</function> À´¹Ø±Õ¡£´ËÖ¸Õë¿ÉÒÔÓÃÓÚ Index: phpdoc-zh/reference/filesystem/functions/readlink.xml diff -u phpdoc-zh/reference/filesystem/functions/readlink.xml:1.3 phpdoc-zh/reference/filesystem/functions/readlink.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/readlink.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/readlink.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.readlink"> <refnamediv> <refname>readlink</refname> @@ -16,6 +16,21 @@ <para> <function>readlink</function> ºÍͬÃûµÄ C º¯Êý×öͬÑùµÄÊ£¬·µ»Ø·ûºÅÁ¬½ÓµÄÄÚÈÝ¡£Èç¹û³ö´í·µ»Ø 0¡£ + </para> + <para> + <example> + <title><function>readlink</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// output e.g. /boot/vmlinux-2.4.20-xfs +echo readlink('/vmlinuz'); + +?> +]]> + </programlisting> + </example> </para> <para> ²Î¼û <function>is_link</function>£¬<function>symlink</function> ºÍ Index: phpdoc-zh/reference/filesystem/functions/realpath.xml diff -u phpdoc-zh/reference/filesystem/functions/realpath.xml:1.3 phpdoc-zh/reference/filesystem/functions/realpath.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/realpath.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/realpath.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.realpath"> <refnamediv> <refname>realpath</refname> @@ -27,7 +27,9 @@ <title><function>realpath</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $real_path = realpath ("../../index.php"); +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/rename.xml diff -u phpdoc-zh/reference/filesystem/functions/rename.xml:1.4 phpdoc-zh/reference/filesystem/functions/rename.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/rename.xml:1.4 Fri Feb 28 03:30:53 2003 +++ phpdoc-zh/reference/filesystem/functions/rename.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: lm92 Status: ready --> <refentry id="function.rename"> <refnamediv> <refname>rename</refname> @@ -14,22 +14,34 @@ <methodparam><type>string</type><parameter>oldname</parameter></methodparam> <methodparam><type>string</type><parameter>newname</parameter></methodparam> </methodsynopsis> - <para> + <para> ³¢ÊÔ°Ñ <parameter>oldname</parameter> ÖØÃüÃûΪ <parameter>newname</parameter>¡£ - </para> - <para> + </para> + <para> &return.success; - <example> - <title><function>rename</function> Àý×Ó </title> - <programlisting role="php"> + </para> + <para> + <example> + <title><function>rename</function> Àý×Ó </title> + <programlisting role="php"> <![CDATA[ <?php - rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); +rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); ?> ]]> - </programlisting> - </example> + </programlisting> + </example> + </para> + <note> + <para> + ÔÚ PHP 4.3.3 ֮ǰ£¬<function>rename</function> ²»ÄÜÔÚ»ùÓÚ + *nix µÄϵͳÖпç´ÅÅÌ·ÖÇøÖØÃüÃûÎļþ¡£ + </para> + </note> + <para> + ²Î¼û <function>copy</function>£¬<function>unlink</function> + ºÍ <function>move_uploaded_file</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/rewind.xml diff -u phpdoc-zh/reference/filesystem/functions/rewind.xml:1.3 phpdoc-zh/reference/filesystem/functions/rewind.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/rewind.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/rewind.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> <refentry id="function.rewind"> <refnamediv> <refname>rewind</refname> @@ -10,14 +10,14 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>rewind</methodname> + <type>bool</type><methodname>rewind</methodname> <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> - <para> + <para> ½« <parameter>handle</parameter> µÄÎļþλÖÃÖ¸ÕëÉèΪÎļþÁ÷µÄ¿ªÍ·¡£ - </para> - <para> - Èç¹û³ö´í·µ»Ø 0£¬·ñÔò·µ»Ø 1¡£ + </para> + <para> + &return.success; </para> <para> ÎļþÖ¸Õë±ØÐëºÏ·¨£¬²¢ÇÒÖ¸ÏòÓÉ <function>fopen</function> Index: phpdoc-zh/reference/filesystem/functions/rmdir.xml diff -u phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.5 phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.5 Fri Feb 28 03:22:08 2003 +++ phpdoc-zh/reference/filesystem/functions/rmdir.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: lm92 Status: ready --> <refentry id="function.rmdir"> <refnamediv> <refname>rmdir</refname> @@ -10,14 +10,13 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>rmdir</methodname> + <type>bool</type><methodname>rmdir</methodname> <methodparam><type>string</type><parameter>dirname</parameter></methodparam> </methodsynopsis> - <para> + <para> ³¢ÊÔɾ³ý <parameter>dirname</parameter> ËùÖ¸¶¨µÄĿ¼¡£ - ¸ÃĿ¼±ØÐëÊǿյ쬶øÇÒÒªÓÐÏàÓ¦µÄȨÏÞ¡£ - &return.success; - </para> + ¸ÃĿ¼±ØÐëÊǿյ쬶øÇÒÒªÓÐÏàÓ¦µÄȨÏÞ¡£&return.success; + </para> <para> ²Î¼û <function>mkdir</function> ºÍ <function>unlink</function>¡£ </para> Index: phpdoc-zh/reference/filesystem/functions/stat.xml diff -u phpdoc-zh/reference/filesystem/functions/stat.xml:1.4 phpdoc-zh/reference/filesystem/functions/stat.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/stat.xml:1.4 Mon May 12 01:23:50 2003 +++ phpdoc-zh/reference/filesystem/functions/stat.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> <refentry id="function.stat"> <refnamediv> <refname>stat</refname> @@ -23,83 +23,98 @@ Èç¹û³ö´í£¬<function>stat</function> ·µ»Ø &false;£¬²¢ÇÒ·¢³öÒ»Ìõ¾¯¸æ¡£ </para> <para> - ·µ»ØÒ»¸öÊý×é°üº¬ÓÐÎļþµÄͳ¼ÆÐÅÏ¢£¬¸ÃÊý×é¾ßÓÐÒÔÏÂÁгöµÄµ¥Ôª£¬Êý×éϱê´ÓÁ㿪ʼ¡£³ýÁËÊý×ÖË÷ÒýÖ®Íâ×Ô PHP 4.0.6 Æð»¹¿ÉÒÔͨ¹ý¹ØÁªË÷ÒýÀ´·ÃÎÊ¡£ - <itemizedlist> - <listitem> - <simpara> - 0 : device - É豸Ãû£¨Ò²¿Éͨ¹ý <literal>dev</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 1 : inode - ½ÚµãºÅ£¨Ò²¿Éͨ¹ý <literal>ino</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 2 : inode protection mode - ½Úµã±£»¤Ä£Ê½£¨Ò²¿Éͨ¹ý <literal>mode</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 3 : number of links - ±»Á¬½ÓµÄÊýÄ¿£¨Ò²¿Éͨ¹ý <literal>nlink</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 4 : user id of owner - ËùÓÐÕßµÄÓû§ ID£¨Ò²¿Éͨ¹ý <literal>uid</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 5 : group id owner - ËùÓÐÕßµÄ×é ID£¨Ò²¿Éͨ¹ý <literal>gid</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 6 : device type if inode device - inode É豸ÀàÐÍ£¨Ò²¿Éͨ¹ý <literal>rdev</literal> ·ÃÎÊ£©* - </simpara> - </listitem> - <listitem> - <simpara> - 7 : size in bytes - ×Ö½ÚÊý£¨Ò²¿Éͨ¹ý <literal>size</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 8 : time of last access - ÎļþÉϴα»·ÃÎʵÄʱ¼ä£¨Ò²¿Éͨ¹ý <literal>atime</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 9 : time of last modification - ÎļþÄÚÈÝÉϴα»Ð޸ĵÄʱ¼ä£¨Ò²¿Éͨ¹ý <literal>mtime</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 10 : time of last change - Îļþ״̬Éϴα»¸Ä±äµÄʱ¼ä£¨Ò²¿Éͨ¹ý <literal>ctime</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 11 : blocksize for filesystem I/O - ÎļþϵͳÖеĿé´óС£¨Ò²¿Éͨ¹ý <literal>blksize</literal> ·ÃÎÊ£©* - </simpara> - </listitem> - <listitem> - <simpara> - 12 : number of blocks allocated - ËùÕ¼ÓÿéµÄÊýÄ¿£¨Ò²¿Éͨ¹ý <literal>blocks</literal> ·ÃÎÊ£© - </simpara> - </listitem> - </itemizedlist> + ·µ»ØÒ»¸öÊý×é°üº¬ÓÐÎļþµÄͳ¼ÆÐÅÏ¢£¬¸ÃÊý×é¾ßÓÐÒÔÏÂÁгöµÄµ¥Ôª£¬Êý×éϱê´ÓÁ㿪ʼ¡£³ýÁËÊý×ÖË÷ÒýÖ®Íâ×Ô + PHP 4.0.6 Æð»¹¿ÉÒÔͨ¹ý¹ØÁªË÷ÒýÀ´·ÃÎÊ¡£ + </para> + <para> + <table> + <title><function>stat</function> ºÍ <function>fstat</function> ·µ»Ø¸ñʽ</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Êý×Öϱê</entry> + <entry>¹ØÁª¼üÃû£¨×Ô PHP 4.0.6£©</entry> + <entry>˵Ã÷</entry> + </row> + </thead> + <tbody> + <row> + <entry>0</entry> + <entry>dev</entry> + <entry>device number - É豸Ãû</entry> + </row> + <row> + <entry>1</entry> + <entry>ino</entry> + <entry>inode number - inode ºÅÂë</entry> + </row> + <row> + <entry>2</entry> + <entry>mode</entry> + <entry>inode protection mode - inode ±£»¤Ä£Ê½</entry> + </row> + <row> + <entry>3</entry> + <entry>nlink</entry> + <entry>number of links - ±»Á¬½ÓÊýÄ¿</entry> + </row> + <row> + <entry>4</entry> + <entry>uid</entry> + <entry>userid of owner - ËùÓÐÕßµÄÓû§id</entry> + </row> + <row> + <entry>5</entry> + <entry>gid</entry> + <entry>groupid of owner- ËùÓÐÕßµÄ×é id</entry> + </row> + <row> + <entry>6</entry> + <entry>rdev</entry> + <entry>device type, if inode device * - É豸ÀàÐÍ£¬Èç¹ûÊÇ inode É豸µÄ»°</entry> + </row> + <row> + <entry>7</entry> + <entry>size</entry> + <entry>size in bytes - Îļþ´óСµÄ×Ö½ÚÊý</entry> + </row> + <row> + <entry>8</entry> + <entry>atime</entry> + <entry>time of last access (unix timestamp) - ÉϴηÃÎÊʱ¼ä£¨Unix ʱ¼ä´Á£©</entry> + </row> + <row> + <entry>9</entry> + <entry>mtime</entry> + <entry>time of last modification (unix timestamp) - ÉÏ´ÎÐÞ¸Äʱ¼ä£¨Unix ʱ¼ä´Á£©</entry> + </row> + <row> + <entry>10</entry> + <entry>ctime</entry> + <entry>time of last change (unix timestamp) - Éϴθıäʱ¼ä£¨Unix ʱ¼ä´Á£©</entry> + </row> + <row> + <entry>11</entry> + <entry>blksize</entry> + <entry>blocksize of filesystem IO * - Îļþϵͳ IO µÄ¿é´óС</entry> + </row> + <row> + <entry>12</entry> + <entry>blocks</entry> + <entry>number of blocks allocated - ËùÕ¼¾Ý¿éµÄÊýÄ¿</entry> + </row> + </tbody> + </tgroup> + </table> * - ½öÔÚÖ§³Ö st_blksize ÀàÐ͵ÄϵͳÏÂÓÐЧ¡£ÆäËüϵͳ£¨Èç Windows£©·µ»Ø -1¡£ </para> - + ¬e.clearstatcache; - + ¬e.no-remote; - + <para> - ²Î¼û <function>lstat</function>£¬<function>filemtime</function> ºÍ + ²Î¼û <function>lstat</function>£¬<function>fstat</function>£¬<function>filemtime</function> ºÍ <function>filegroup</function>¡£ </para> </refsect1> Index: phpdoc-zh/reference/filesystem/functions/symlink.xml diff -u phpdoc-zh/reference/filesystem/functions/symlink.xml:1.3 phpdoc-zh/reference/filesystem/functions/symlink.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/symlink.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/symlink.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.symlink"> <refnamediv> <refname>symlink</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>symlink</methodname> + <type>bool</type><methodname>symlink</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>string</type><parameter>link</parameter></methodparam> </methodsynopsis> @@ -18,6 +18,9 @@ <function>symlink</function> ¶ÔÓÚÒÑÓÐµÄ <parameter>target</parameter> ½¨Á¢Ò»¸öÃûΪ <parameter>link</parameter> µÄ·ûºÅÁ¬½Ó¡£ + </para> + <para> + &return.success; </para> <para> ²Î¼û <function>link</function> À´½¨Á¢Ó²Á¬½Ó£¬ÒÔ¼° Index: phpdoc-zh/reference/filesystem/functions/tempnam.xml diff -u phpdoc-zh/reference/filesystem/functions/tempnam.xml:1.3 phpdoc-zh/reference/filesystem/functions/tempnam.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/tempnam.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/tempnam.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> @@ -27,21 +27,26 @@ ²ÎÊý£¬Èç¹ûÆäÖ¸ÏòµÄĿ¼´æÔڵϰ¡£Èç¹ûÓÐÒÉÎÊÇë²Î¿¼ÏµÍ³ÎĵµÖÐµÄ tempnam(3) º¯Êý¡£ </para> + <note> + <simpara> + Èç¹û PHP ²»ÄÜÔÚÖ¸¶¨µÄ <parameter>dir</parameter> + ²ÎÊýÖд´½¨Îļþ£¬ÔòÍ˻ص½ÏµÍ³Ä¬ÈÏÖµ¡£ + </simpara> + </note> <para> ·µ»ØÐµÄÁÙʱÎļþÃû£¬³ö´í·µ»Ø &false; ×Ö·û´®¡£ <example> <title><function>tempnam</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $tmpfname = tempnam ("/tmp", "FOO"); - $handle = fopen($tmpfname, "w"); fwrite($handle, "writing to tempfile"); fclose($handle); - // do here something - unlink($tmpfname); +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/tmpfile.xml diff -u phpdoc-zh/reference/filesystem/functions/tmpfile.xml:1.3 phpdoc-zh/reference/filesystem/functions/tmpfile.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/tmpfile.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/tmpfile.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> @@ -28,9 +28,11 @@ <title><function>tmpfile</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $temp = tmpfile(); fwrite($temp, "writing to tempfile"); fclose($temp); // this removes the file +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/touch.xml diff -u phpdoc-zh/reference/filesystem/functions/touch.xml:1.3 phpdoc-zh/reference/filesystem/functions/touch.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/touch.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/touch.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> <refentry id="function.touch"> <refnamediv> <refname>touch</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>touch</methodname> + <type>bool</type><methodname>touch</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>time</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>atime</parameter></methodparam> @@ -24,20 +24,21 @@ <parameter>atime</parameter>¡£×¢Òâ·ÃÎÊʱ¼ä×ÜÊǻᱻÐ޸ĵ쬲»ÂÛÓм¸¸ö²ÎÊý¡£ </para> <para> - Èç¹ûÎļþ²»´æÔÚ£¬Ôò»á±»´´½¨¡£ + Èç¹ûÎļþ²»´æÔÚ£¬Ôò»á±»´´½¨¡£&return.success; </para> <para> - &return.success; <example> <title><function>touch</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php if (touch ($FileName)) { - print "$FileName modification time has been + print "$FileName modification time has been changed to todays date and time"; } else { print "Sorry Could Not change modification time of $FileName"; } +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/unlink.xml diff -u phpdoc-zh/reference/filesystem/functions/unlink.xml:1.5 phpdoc-zh/reference/filesystem/functions/unlink.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/unlink.xml:1.5 Thu May 15 15:45:59 2003 +++ phpdoc-zh/reference/filesystem/functions/unlink.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: lm92 Status: ready --> <!-- CREDITS: dallas --> <refentry id="function.unlink"> <refnamediv> @@ -10,16 +10,13 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>unlink</methodname> - <methodparam><type>string</type><parameter>filename</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>unlink</methodname> + <methodparam><type>string</type><parameter>filename</parameter></methodparam> + </methodsynopsis> <para> ɾ³ý <parameter>filename</parameter>¡£ºÍ Unix C µÄ - unlink() º¯ÊýÏàËÆ¡£ - </para> - <para> - &return.success; + unlink() º¯ÊýÏàËÆ¡£&return.success; </para> <note> <simpara>
Index: phpdoc-zh/reference/filesystem/functions/flock.xml diff -u phpdoc-zh/reference/filesystem/functions/flock.xml:1.4 phpdoc-zh/reference/filesystem/functions/flock.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/flock.xml:1.4 Mon Feb 24 10:11:26 2003 +++ phpdoc-zh/reference/filesystem/functions/flock.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: lm92 Status: ready --> +<!-- CREDITS: dallas --> <refentry id="function.flock"> <refnamediv> <refname>flock</refname> @@ -16,70 +17,93 @@ <methodparam choice="opt"><type>int</type><parameter>&wouldblock</parameter></methodparam> </methodsynopsis> <simpara> - PHP Ö§³ÖÒÔ×Éѯ·½Ê½£¨Ò²¾ÍÊÇ˵ËùÓзÃÎʳÌÐò±ØÐëʹÓÃͬÒâ·½Ê½Ëø¶¨, ·ñÔòËü²»»á¹¤×÷£©Ëø¶¨È«²¿ÎļþµÄÒ»ÖÖÇá±ã·½·¨¡£ + PHP Ö§³ÖÒÔ×Éѯ·½Ê½£¨Ò²¾ÍÊÇ˵ËùÓзÃÎʳÌÐò±ØÐëʹÓÃͬһ·½Ê½Ëø¶¨, ·ñÔòËü²»»á¹¤×÷£©Ëø¶¨È«²¿ÎļþµÄÒ»ÖÖÇá±ã·½·¨¡£ </simpara> <simpara> <function>flock</function> ²Ù×÷µÄ <parameter>handle</parameter> - ±ØÐëÊÇÒ»¸öÒѾ´ò¿ªµÄÎļþÖ¸Õë¡£ - <parameter>operation</parameter> ¿ÉÒÔÊÇÒÔÏÂÖµÖ®Ò»£º + ±ØÐëÊÇÒ»¸öÒѾ´ò¿ªµÄÎļþÖ¸Õë¡£<parameter>operation</parameter> + ¿ÉÒÔÊÇÒÔÏÂÖµÖ®Ò»£º </simpara> <para> <itemizedlist> <listitem> <simpara> - ҪȡµÃ¹²ÏíËø¶¨£¨¿É¶Á£©£¬½« - <parameter>operation</parameter> ÉèΪ <constant>LOCK_SH</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÉèÖÃΪ 1£©¡£ + ҪȡµÃ¹²ÏíËø¶¨£¨¶ÁÈ¡³ÌÐò£©£¬½« + <parameter>operation</parameter> ÉèΪ <constant>LOCK_SH</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÉèÖÃΪ 1£©¡£ </simpara> </listitem> <listitem> <simpara> - ҪȡµÃ¶ÀÕ¼Ëø¶¨£¨¿Éд£©£¬½« - <parameter>operation</parameter> ÉèΪ <constant>LOCK_EX</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 2£©¡£ + ҪȡµÃ¶ÀÕ¼Ëø¶¨£¨Ð´Èë³ÌÐò£©£¬½« + <parameter>operation</parameter> ÉèΪ <constant>LOCK_EX</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 2£©¡£ </simpara> </listitem> <listitem> <simpara> - ÒªÊÍ·ÅËø¶¨£¨ÎÞÂÛ¹²Ïí»ò¶ÀÕ¼£©£¬½« - <parameter>operation</parameter> ÉèΪ <constant>LOCK_UN</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 3£©¡£ + ÒªÊÍ·ÅËø¶¨£¨ÎÞÂÛ¹²Ïí»ò¶ÀÕ¼£©£¬½« + <parameter>operation</parameter> ÉèΪ <constant>LOCK_UN</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 3£©¡£ </simpara> </listitem> <listitem> <simpara> - Èç¹ûÄ㲻ϣÍû <function>flock</function> ÔÚËø¶¨Ê±¶ÂÈû£¬Ôò¸ø - <parameter>operation</parameter> Ôö¼Ó <constant>LOCK_NB</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 4£©¡£ + Èç¹ûÄ㲻ϣÍû <function>flock</function> ÔÚËø¶¨Ê±¶ÂÈû£¬Ôò¸ø + <parameter>operation</parameter> ¼ÓÉÏ <constant>LOCK_NB</constant>£¨PHP 4.0.1 ÒÔǰµÄ°æ±¾ÖÐÉèÖÃΪ 4£©¡£ </simpara> </listitem> </itemizedlist> </para> <simpara> <function>flock</function> ÔÊÐíÄãÖ´ÐÐÒ»¸ö¼òµ¥µÄ¿ÉÒÔÔÚÈÎºÎÆ½Ì¨ÖÐʹÓõĶÁÈ¡/дÈëÄ£ÐÍ£¨°üÀ¨´ó²¿·ÖµÄ - Unix ÅÉÉú°æºÍÉõÖÁÊÇ Windows£©¡£Èç¹ûËø¶¨»á¶ÂÈûµÄ»°£¨EWOULDBLOCK errno condition£©£¬Ç뽫¿ÉÑ¡µÄµÚÈý¸ö²ÎÊýÉèÖÃΪ &true;¡£ + Unix ÅÉÉú°æºÍÉõÖÁÊÇ Windows£©¡£Èç¹ûËø¶¨»á¶ÂÈûµÄ»°£¨EWOULDBLOCK ´íÎóÂëÇé¿öÏ£©£¬Ç뽫¿ÉÑ¡µÄµÚÈý¸ö²ÎÊýÉèÖÃΪ &true;¡£ </simpara> <simpara> &return.success; </simpara> + <para> + <example> + <title><function>flock</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$fp = fopen("/tmp/lock.txt", "w+"); + +if (flock($fp, LOCK_EX)) { // ½øÐÐÅÅËüÐÍËø¶¨ + fwrite($fp, "Write something here\n"); + flock($fp, LOCK_UN); // ÊÍ·ÅËø¶¨ +} else { + echo "Couldn't lock the file !"; +} + +fclose($fp); + +?> +]]> + </programlisting> + </example> + </para> <note> <para> - ÓÉÓÚ <function>flock</function> ÐèÒªÒ»¸öÎļþÖ¸Õ룬 Òò´ËÄã¿ÉÄÜ - ÐèÒªÒ»¸öËø¶¨ÎļþÀ´±£»¤µ½Äã´òËãͨ¹ýдģʽ´ò¿ªÀ´½Ø¶ÏµÄÎļþµÄ·ÃÎÊ£¨ÔÚ + ÓÉÓÚ <function>flock</function> + ÐèÒªÒ»¸öÎļþÖ¸Õ룬 Òò´ËÄã¿ÉÄÜÐèÒªÒ»¸öËø¶¨ÎļþÀ´±£»¤µ½Äã´òËãͨ¹ýдģʽ´ò¿ªÀ´½Ø¶ÏµÄÎļþµÄ·ÃÎÊ£¨ÔÚ <function>fopen</function> º¯ÊýÖмÓÈë "w" »ò "w+"£©¡£ </para> </note> <warning> <para> - <function>flock</function> ²»ÄÜÔÚNFSÒÔ¼°ÆäËûµÄÒ»Ð©ÍøÂçÎļþϵͳÖÐÕý³£¹¤×÷¡£Ïêϸ×ÊÁÏÇë¼ì²éÄãµÄ²Ù×÷ϵͳÎĵµ¡£ + <function>flock</function> ²»ÄÜÔÚ NFS + ÒÔ¼°ÆäËûµÄÒ»Ð©ÍøÂçÎļþϵͳÖÐÕý³£¹¤×÷¡£Ïêϸ×ÊÁÏÇë¼ì²éÄãµÄ²Ù×÷ϵͳÎĵµ¡£ </para> <para> - ÔÚ²¿·Ö²Ù×÷ϵͳÖУ¬ <function>flock</function> ÒÔ´¦Àí¼¶Ö´ÐС£ - µ±ÓÃÒ»¸ö¶àÏ̷߳þÎñÆ÷ API£¨±ÈÈç ISAPI£©Ê±£¬ - Äú¿ÉÄܲ»¿ÉÒÔÒÀ¿¿ <function>flock</function> À´±£»¤Îļþ£¬ - ÒòΪÔÚͬһ·þÎñÆ÷ÄÚÔËÐÐÔÚÆäËü³ÌÏßµÄPHP½Å±¾¿ÉÒÔ¶Ô¸ÃÎļþ½øÐд¦Àí¡£ - instance! + ÔÚ²¿·Ö²Ù×÷ϵͳÖУ¬<function>flock</function> ÒÔ´¦Àí¼¶Ö´ÐС£µ±ÓÃÒ»¸ö¶àÏ̷߳þÎñÆ÷ + API£¨±ÈÈç ISAPI£©Ê±£¬Äú¿ÉÄܲ»¿ÉÒÔÒÀ¿¿ + <function>flock</function> À´±£»¤Îļþ£¬ÒòΪÔÚͬһ·þÎñÆ÷ÄÚÔËÐÐÔÚÆäËüÏß³ÌµÄ + PHP ½Å±¾¿ÉÒÔ¶Ô¸ÃÎļþ½øÐд¦Àí¡£ </para> <para> - <function>flock</function> ²»Ö§³Ö¾ÉµÄÎļþϵͳ£¬Èç - <literal>FAT</literal> ÒÔ¼°ËüµÄÅÉÉúϵͳ¡£Òò´Ë£¬ËüÔÚÕâÖÖÇé¿öϾ³£»á·µ»Ø - Ò»¸ö &false; Öµ£¨ÓÈÆäÊÇÖ¸Windows 98µÄÓû§£©¡£ + <function>flock</function> ²»Ö§³Ö¾ÉµÄÎļþϵͳ£¬Èç <literal>FAT</literal> + ÒÔ¼°ËüµÄÅÉÉúϵͳ¡£Òò´Ë£¬ËüÔÚÕâÖÖÇé¿öϾ³£»á·µ»ØÒ»¸ö &false; + Öµ£¨ÓÈÆäÊÇÖ¸ Windows 98 µÄÓû§£©¡£ </para> </warning> </refsect1> Index: phpdoc-zh/reference/filesystem/functions/fnmatch.xml diff -u phpdoc-zh/reference/filesystem/functions/fnmatch.xml:1.2 phpdoc-zh/reference/filesystem/functions/fnmatch.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/fnmatch.xml:1.2 Fri Feb 28 04:30:51 2003 +++ phpdoc-zh/reference/filesystem/functions/fnmatch.xml Mon Aug 18 19:23:46 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.fnmatch"> <refnamediv> - <refname>fnmatch</refname> + <refname>fnmatch</refname> <refpurpose>ÓÃģʽƥÅäÎļþÃû</refpurpose> </refnamediv> <refsect1> @@ -38,9 +38,11 @@ </title> <programlisting role="php"> <![CDATA[ +<?php if(fnmatch("*gr[ae]y", $color)) { echo "some form of gray ..."; } +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/fopen.xml diff -u phpdoc-zh/reference/filesystem/functions/fopen.xml:1.5 phpdoc-zh/reference/filesystem/functions/fopen.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/fopen.xml:1.5 Sun Apr 20 02:35:00 2003 +++ phpdoc-zh/reference/filesystem/functions/fopen.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.18 Maintainer: dallas Status: ready --> <!-- CREDITS: lm92 --> <refentry id="function.fopen"> <refnamediv> @@ -49,9 +49,9 @@ <simpara> ËùÖ§³ÖµÄÐÒéÁбí¼û<xref linkend="wrappers"/>¡£Ä³Ð©ÐÒ飨Ҳ±»³ÆÎª <literal>wrappers</literal>£©Ö§³Ö - <literal>context</literal> ºÍ <literal>php.ini</literal> + <literal>context</literal> ºÍ &php.ini; Ñ¡Ïî¡£²Î¼ûÏàÓ¦µÄÒ³ÃæÄÄЩѡÏî¿ÉÒÔ±»É趨¡££¨Ò²¾ÍÊÇ - <literal>php.ini</literal> µÄÖµ + &php.ini; µÄÖµ <literal>user_agent</literal> ÓÃÔÚ <literal>http</literal> ÐÒéÖС££©ÓÐ¹Ø <literal>contexts</literal> ºÍ <parameter>zcontext</parameter> ²ÎÊýµÄ˵Ã÷£¬²Î¼û <xref linkend="ref.stream"/>¡£ @@ -109,16 +109,80 @@ ¶Áд·½Ê½´ò¿ª£¬½«ÎļþÖ¸ÕëÖ¸ÏòÎļþĩβ¡£Èç¹ûÎļþ²»´æÔÚÔò³¢ÊÔ´´½¨Ö®¡£ </entry> </row> + <row> + <entry><literal>'x'</literal></entry> + <entry> + ´´½¨²¢ÒÔдÈ뷽ʽ´ò¿ª£¬½«ÎļþÖ¸ÕëÖ¸ÏòÎļþÍ·¡£Èç¹ûÎļþÒÑ´æÔÚ£¬Ôò + <function>fopen</function> µ÷ÓÃʧ°Ü²¢·µ»Ø &false;£¬²¢Éú³ÉÒ»Ìõ + <constant>E_WARNING</constant> ¼¶±ðµÄ´íÎóÐÅÏ¢¡£Èç¹ûÎļþ²»´æÔÚÔò³¢ÊÔ´´½¨Ö®¡£ÕâºÍ¸ø + µ×²ãµÄ <literal>open(2)</literal> ϵͳµ÷ÓÃÖ¸¶¨ + <literal>O_EXCL|O_CREAT</literal> ±ê¼ÇÊǵȼ۵ġ£´ËÑ¡Ïî±» + PHP 4.3.2 ÒÔ¼°ÒÔºóµÄ°æ±¾ËùÖ§³Ö£¬½öÄÜÓÃÓÚ±¾µØÎļþ¡£ + </entry> + </row> + <row> + <entry><literal>'x+'</literal></entry> + <entry> + ´´½¨²¢ÒÔ¶Áд·½Ê½´ò¿ª£¬½«ÎļþÖ¸ÕëÖ¸ÏòÎļþÍ·¡£Èç¹ûÎļþÒÑ´æÔÚ£¬Ôò + <function>fopen</function> µ÷ÓÃʧ°Ü²¢·µ»Ø &false;£¬²¢Éú³ÉÒ»Ìõ + <constant>E_WARNING</constant> ¼¶±ðµÄ´íÎóÐÅÏ¢¡£Èç¹ûÎļþ²»´æÔÚÔò³¢ÊÔ´´½¨Ö®¡£ÕâºÍ¸ø + µ×²ãµÄ <literal>open(2)</literal> ϵͳµ÷ÓÃÖ¸¶¨ + <literal>O_EXCL|O_CREAT</literal> ±ê¼ÇÊǵȼ۵ġ£´ËÑ¡Ïî±» + PHP 4.3.2 ÒÔ¼°ÒÔºóµÄ°æ±¾ËùÖ§³Ö£¬½öÄÜÓÃÓÚ±¾µØÎļþ¡£ + </entry> + </row> </tbody> </tgroup> </table> </para> <note> <para> - <parameter>mode</parameter> ¿ÉÒÔ°üÀ¨×Öĸ - 'b'£¬½öÔÚÇø·Ö¶þ½øÖƺÍÎı¾ÎļþµÄϵͳÏÂÓÐÓã¨ÀýÈç - Windows¡£ÔÚ UNIX ÏÂûÓÐÓã©¡£Èç¹û²»ÐèÒª½«±»ºöÂÔ¡£¹ÄÀøÓû§°üÀ¨ - 'b' ±ê¼ÇÒÔʹ½Å±¾¾ßÓиüºÃµÄÒÆÖ²ÐÔ¡£ + ²»Í¬µÄ²Ù×÷ϵͳ¼Ò×å¾ßÓв»Í¬µÄÐнáÊøÏ°¹ß¡£µ±ÄãдÈëÒ»¸öÎı¾Îļþ²¢Ïë²åÈëÒ»¸öÐÂÐÐʱ£¬ÄãÐèҪʹÓ÷ûºÏÄã²Ù×÷ϵͳµÄÐнáÊø·ûºÅ¡£»ùÓÚ + Unix µÄϵͳʹÓà <literal>\n</literal> + ×÷ΪÐнáÊø×Ö·û£¬»ùÓÚ Windows µÄϵͳʹÓà <literal>\r\n</literal> + ×÷ΪÐнáÊø×Ö·û£¬»ùÓÚ Macintosh µÄϵͳʹÓà <literal>\r</literal> + ×÷ΪÐнáÊø×Ö·û¡£ + </para> + <para> + Èç¹ûдÈëÎļþʱʹÓÃÁË´íÎóµÄÐнáÊø·ûºÅ£¬ÔòÆäËüÓ¦ÓóÌÐò´ò¿ªÕâЩÎļþʱ¿ÉÄÜ»á±íÏֵúܹÖÒì¡£ + </para> + <para> + Windows ÏÂÌṩÁËÒ»¸öÎı¾×ª»»±ê¼Ç£¨<literal>'t'</literal>£©¿ÉÒÔ͸Ã÷µØ½« + <literal>\n</literal> ת»»Îª <literal>\r\n</literal>¡£Óë´Ë¶ÔÓ¦Ä㻹¿ÉÒÔʹÓà + <literal>'b'</literal> À´Ç¿ÖÆÊ¹Óöþ½øÖÆÄ£Ê½£¬ÕâÑù¾Í²»»áת»»ÄãµÄÊý¾Ý¡£ÒªÊ¹ÓÃÕâЩ±ê¼Ç£¬ÒªÃ´Óà + <literal>'b'</literal> »òÕßÓà <literal>'t'</literal> ×÷Ϊ + <parameter>mode</parameter> ²ÎÊýµÄ×îºóÒ»¸ö×Ö·û¡£ + </para> + <para> + ĬÈϵÄת»»Ä£Ê½ÒÀÀµÓÚ SAPI ºÍÄãʹÓÃµÄ PHP + °æ±¾£¬Òò´ËΪÁ˱ãÓÚÒÆÖ²¹ÄÀøÄã×ÜÊÇÖ¸¶¨Ç¡µ±µÄ±ê¼Ç¡£µ±²Ù×÷ÒÔ + <literal>\n</literal> ×÷ΪÐнáÊø¶¨½ç·ûµÄ´¿Îı¾Îļþʱ£¬Èç¹ûÄ㻹ÆÚÍûÕâЩÎļþ¿ÉÒÔÓÃÓÚÆäËüÓ¦ÓóÌÐòÀýÈç + Notepad£¬ÔòÓ¦¸ÃÔڽű¾ÖÐʹÓà <literal>'t'</literal> + ģʽ¡£ÔÚËùÓÐÆäËüÇé¿öÏÂʹÓà <literal>'b'</literal>¡£ + </para> + <para> + ÔÚ²Ù×÷¶þ½øÖÆÎļþʱÈç¹ûûÓÐÖ¸¶¨ <literal>'b'</literal> + ±ê¼Ç£¬¿ÉÄÜ»áÅöµ½Ò»Ð©Ææ¹ÖµÄÎÊÌ⣬°üÀ¨»µµôµÄͼƬÎļþÒÔ¼°¹ØÓÚ + <literal>\r\n</literal> ×Ö·ûµÄÆæ¹ÖÎÊÌâ¡£ + </para> + <para> + <emphasis> + ÎªÒÆÖ²ÐÔ¿¼ÂÇ£¬Ç¿ÁÒ½¨ÒéÔÚÓà <function>fopen</function> + ´ò¿ªÎļþʱ×ÜÊÇʹÓà <literal>'b'</literal> ±ê¼Ç¡£ + </emphasis> + </para> + <para> + <emphasis> + ÔÙÒ»´Î£¬ÎªÒÆÖ²ÐÔ¿¼ÂÇ£¬Ç¿ÁÒ½¨ÒéÄãÖØÐ´ÄÇЩÒÀÀµÓÚ + <literal>'t'</literal> ģʽµÄ´úÂëʹÆäʹÓÃÕýÈ·µÄÐнáÊø·û²¢¸Ä³É + <literal>'b'</literal> ģʽ¡£ + </emphasis> + </para> + <para> + <emphasis> + ×Ô PHP 4.3.2 Æð£¬¶ÔËùÓÐÇø±ð¶þ½øÖƺÍÎı¾Ä£Ê½µÄƽ̨ĬÈÏģʽ¶¼±»ÉèΪ¶þ½øÖÆÄ£Ê½¡£Èç¹ûÄãÔÚÉý¼¶ºó½Å±¾Åöµ½ÎÊÌ⣬³¢ÊÔÔÝʱʹÓà + <literal>'t'</literal> ±ê¼Ç£¬Ö±µ½ËùÓеĽű¾¶¼ÕÕÒÔÉÏËù˵µÄ¸ÄΪ¸ü¾ßÒÆÖ²ÐÔÒÔºó¡£ + </emphasis> </para> </note> <para> @@ -153,7 +217,7 @@ <para> ÔÚ Windows ƽ̨ÉÏ£¬ÒªÐ¡ÐÄתÒåÎļþ·¾¶ÖеÄÿ¸ö·´Ð±Ïߣ¬»òÕßÓÃбÏß¡£ <informalexample> - <programlisting role="php"> + <programlisting role="php"> <![CDATA[ <?php $handle = fopen ("c:\\data\\info.txt", "r"); @@ -163,7 +227,7 @@ </informalexample> </para> <simpara> - ²Î¼û<xref linkend="wrappers"/>£¬<function>fclose</function>£¬<function>fgets</function>£¬<function>fsockopen</function>£¬<function>file</function>£¬<function>file_exists</function>£¬<function>is_readable</function>£¬<function>socket_set_timeout</function> + ²Î¼û<xref linkend="wrappers"/>£¬<function>fclose</function>£¬<function>fgets</function>£¬<function>fread</function>£¬<function>fwrite</function>£¬<function>fsockopen</function>£¬<function>file</function>£¬<function>file_exists</function>£¬<function>is_readable</function>£¬<function>stream_set_timeout</function> ºÍ <function>popen</function>¡£ </simpara> </refsect1> Index: phpdoc-zh/reference/filesystem/functions/fpassthru.xml diff -u phpdoc-zh/reference/filesystem/functions/fpassthru.xml:1.5 phpdoc-zh/reference/filesystem/functions/fpassthru.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/fpassthru.xml:1.5 Fri Feb 28 04:30:51 2003 +++ phpdoc-zh/reference/filesystem/functions/fpassthru.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <!-- CREDITS: lm92 --> <refentry id="function.fpassthru"> <refnamediv> @@ -10,10 +10,10 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>fpassthru</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>int</type><methodname>fpassthru</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + </methodsynopsis> <simpara> ½«¸ø¶¨µÄÎļþÖ¸Õë´Óµ±Ç°µÄλÖöÁÈ¡µ½ EOF ²¢°Ñ½á¹ûдµ½Êä³ö»º³åÇø¡£ </simpara> @@ -50,6 +50,30 @@ ±êÖ¾£¬¼´Ê¹ÏµÍ³²¢²»ÐèÒª£¬ÕâÑù¿ÉÒÔʹ½Å±¾µÄÒÆÖ²ÐÔ¸üºÃ¡£ </para> </note> + <para> + <example> + <title>¶Ô¶þ½øÖÆÎļþʹÓà <function>fpassthru</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +// open the file in a binary mode +$name = ".\public\dev\img\ok.png"; +$fp = fopen($name, 'rb'); + +// send the right headers +header("Content-Type: image/png"); +header("Content-Length: ".filesize($name)); + +// dump the picture and stop the script +fpassthru($fp); +exit; + +?> +]]> + </programlisting> + </example> + </para> <simpara> ²Î¼û <function>readfile</function>£¬<function>fopen</function>£¬<function>popen</function> Index: phpdoc-zh/reference/filesystem/functions/fread.xml diff -u phpdoc-zh/reference/filesystem/functions/fread.xml:1.4 phpdoc-zh/reference/filesystem/functions/fread.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/fread.xml:1.4 Fri Feb 28 03:22:08 2003 +++ phpdoc-zh/reference/filesystem/functions/fread.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.14 Maintainer: lm92 Status: ready --> +<!-- CREDITS: dallas --> <refentry id="function.fread"> <refnamediv> <refname>fread</refname> @@ -19,9 +20,9 @@ <parameter>handle</parameter> ¶ÁÈ¡×î¶à <parameter>length</parameter> ¸ö×Ö½Ú¡£ ¸Ãº¯ÊýÔÚ¶ÁÈ¡Íê - <parameter>length</parameter> ¸ö×Ö½ÚÊý»òµ½´ï - EOF µÄʱºò¾Í»áÍ£Ö¹¶ÁÈ¡Îļþ£¬ÊÓºõÏÈÅöµ½ÄÄÖÖÇé¿ö¡£ - </simpara> + <parameter>length</parameter> ¸ö×Ö½ÚÊý£¬»òµ½´ï + EOF µÄʱºò£¬»ò£¨¶ÔÓÚÍøÂçÁ÷£©µ±Ò»¸ö°ü¿ÉÓÃʱ¾Í»áÍ£Ö¹¶ÁÈ¡Îļþ£¬ÊÓºõÏÈÅöµ½ÄÄÖÖÇé¿ö¡£ + </simpara> <para> <informalexample> <programlisting role="php"> @@ -35,12 +36,12 @@ </programlisting> </informalexample> </para> - <note> + <warning> <para> - ÔÚÇø·Ö¶þ½øÖÆÎļþºÍÎı¾ÎļþµÄϵͳÉÏ£¨Èç Windows£© - ´ò¿ªÎļþʱ£¬<function>fopen</function> º¯ÊýµÄ mode ²ÎÊýÒª¼ÓÉÏ 'b'¡£ + ÔÚÇø·Ö¶þ½øÖÆÎļþºÍÎı¾ÎļþµÄϵͳÉÏ£¨Èç + Windows£©´ò¿ªÎļþʱ£¬<function>fopen</function> º¯ÊýµÄ mode ²ÎÊýÒª¼ÓÉÏ 'b'¡£ </para> - </note> + </warning> <para> <informalexample> <programlisting role="php"> @@ -53,10 +54,50 @@ </programlisting> </informalexample> </para> + <warning> + <para> + µ±´ÓÍøÂçÁ÷»òÕ߹ܵÀ¶Áȡʱ£¬ÀýÈçÔÚ¶ÁÈ¡´Ó<link + linkend="features.remote-files">Ô¶³ÌÎļþ</link>»ò + <function>popen</function> ÒÔ¼° <function>proc_open</function> + µÄ·µ»ØÊ±£¬¶ÁÈ¡»áÔÚÒ»¸ö°ü¿ÉÓÃÖ®ºóÍ£Ö¹¡£ÕâÒâζ×ÅÄãÓ¦¸ÃÈçÏÂÀýËùʾ½«Êý¾ÝÊÕ¼¯ÆðÀ´ºÏ²¢³É´ó¿é¡£ + </para> + </warning> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$handle = fopen ("http://www.example.com/", "rb"); +$contents = ""; +do { + $data = fread($handle, 8192); + if (strlen($data) == 0) { + break; + } + $contents .= $data; +} while(true); +fclose ($handle); +?> +]]> + </programlisting> + </informalexample> + </para> + <note> + <para> + ÉÏÀý±È´«Í³µÄʹÓà while(!<function>feof</function>) + µÄ·½·¨ÐÔÄÜÒªºÃ£¬ÒòΪÔÚÿ¸öÑ»·ÖнÚÔ¼Á˺¯Êýµ÷Óõύ·Ñ¡£ + </para> + </note> + <note> + <para> + Èç¹ûÄãÖ»ÊÇÏ뽫һ¸öÎļþµÄÄÚÈݶÁÈëµ½Ò»¸ö×Ö·û´®ÖУ¬Óà + <function>file_get_contents</function>£¬ËüµÄÐÔÄܱÈÉÏÃæµÄ´úÂëºÃµÃ¶à¡£ + </para> + </note> <simpara> ²Î¼û - <function>fwrite</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function>£¬<function>fgets</function>£¬<function>fgetss</function>£¬<function>fscanf</function>£¬<function>file</function> ºÍ - <function>fpassthru</function>¡£ + <function>fwrite</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function>£¬<function>fgets</function>£¬<function>fgetss</function>£¬<function>fscanf</function>£¬<function>file</function> + ºÍ <function>fpassthru</function>¡£ </simpara> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/fscanf.xml diff -u phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.2 phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/fscanf.xml:1.2 Fri Apr 11 12:18:46 2003 +++ phpdoc-zh/reference/filesystem/functions/fscanf.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.fscanf"> <refnamediv> <refname>fscanf</refname> @@ -31,25 +31,27 @@ <title><function>fscanf</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $handle = fopen ("users.txt","r"); while ($userinfo = fscanf ($handle, "%s\t%s\t%s\n")) { list ($name, $profession, $countrycode) = $userinfo; //... do something with the values } fclose($handle); +?> ]]> </programlisting> </example> <example> <title>users.txt</title> - <programlisting> + <screen> <![CDATA[ javier argonaut pe hiroshi sculptor jp robert slacker us luigi florist it ]]> - </programlisting> + </screen> </example> </para> <note> Index: phpdoc-zh/reference/filesystem/functions/fseek.xml diff -u phpdoc-zh/reference/filesystem/functions/fseek.xml:1.2 phpdoc-zh/reference/filesystem/functions/fseek.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/fseek.xml:1.2 Fri Apr 11 12:18:47 2003 +++ phpdoc-zh/reference/filesystem/functions/fseek.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> @@ -9,12 +9,12 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>fseek</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - <methodparam><type>int</type><parameter>offset</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>int</type><methodname>fseek</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + <methodparam><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> + </methodsynopsis> <para> ÔÚÓë <parameter>handle</parameter> @@ -37,7 +37,28 @@ <constant>SEEK_SET</constant>¡£ </para> <para> - ³É¹¦·µ»Ø 0£»·ñÔò·µ»Ø -1¡£×¢ÒâÒÆ¶¯µ½ EOF Ö®ºóµÄλÖò»Ëã´íÎó¡£ + ³É¹¦Ôò·µ»Ø 0£»·ñÔò·µ»Ø -1¡£×¢ÒâÒÆ¶¯µ½ EOF Ö®ºóµÄλÖò»Ëã´íÎó¡£ + </para> + <para> + <example> + <title><function>fseek</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$fp = fopen('somefile.txt'); + +// read some data +$data = fgets($fp, 4096); + +// move back to the begining of the file +// same as rewind($fp); +fseek($fp, 0); + +?> +]]> + </programlisting> + </example> </para> <para> ¿ÉÄܲ»ÄÜÓÃÓÚÔÚ Index: phpdoc-zh/reference/filesystem/functions/fstat.xml diff -u phpdoc-zh/reference/filesystem/functions/fstat.xml:1.3 phpdoc-zh/reference/filesystem/functions/fstat.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/fstat.xml:1.3 Wed Apr 23 19:11:11 2003 +++ phpdoc-zh/reference/filesystem/functions/fstat.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> <refentry id="function.fstat"> <refnamediv> <refname>fstat</refname> @@ -9,36 +9,69 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>array</type><methodname>fstat</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>array</type><methodname>fstat</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + </methodsynopsis> <para> »ñÈ¡ÓÉÎļþÖ¸Õë <parameter>handle</parameter> Ëù´ò¿ªÎļþµÄͳ¼ÆÐÅÏ¢¡£±¾º¯ÊýºÍ <function>stat</function> º¯ÊýÏàËÆ£¬³ýÁËËüÊÇ×÷ÓÃÓÚÒÑ´ò¿ªµÄÎļþÖ¸Õë¶ø²»ÊÇÎļþÃû¡£ </para> <para> - ·µ»ØÒ»¸öÊý×é°üº¬ÓÐÎļþµÄͳ¼ÆÐÅÏ¢¡£¸ÃÊý×é¾ßÓÐÒÔϵ¥Ôª£º - <orderedlist> - <listitem><simpara>device - É豸Ãû</simpara></listitem> - <listitem><simpara>inode - ½ÚµãÃû</simpara></listitem> - <listitem><simpara>number of links - Á¬½ÓÊýÄ¿</simpara></listitem> - <listitem><simpara>user id of owner - ËùÓÐÕßµÄÓû§ id</simpara></listitem> - <listitem><simpara>group id owner - ËùÓÐÕßµÄ×é id</simpara></listitem> - <listitem><simpara>device type if inode device *</simpara></listitem> - <listitem><simpara>size in bytes - Îļþ´óСµÄ×Ö½ÚÊý</simpara></listitem> - <listitem><simpara>time of last access - ÉÏÒ»´Î±»·ÃÎÊʱ¼ä</simpara></listitem> - <listitem><simpara>time of last modification - ÉÏÒ»´Î±»ÐÞ¸Äʱ¼ä</simpara></listitem> - <listitem><simpara>time of last change - ÉÏÒ»´Î¸Ä±äʱ¼ä</simpara></listitem> - <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> - <listitem><simpara>number of blocks allocated - Ëù·ÖÅä¿éµÄÊýÄ¿</simpara></listitem> - </orderedlist> - * - ½öÔÚÖ§³Ö st_blksize ÀàÐ͵ÄϵͳÏÂÓÐЧ¡£ÆäËüϵͳ£¨Èç Windows£©·µ»Ø -1¡£ + ·µ»ØÒ»¸öÊý×é¾ßÓиÃÎļþµÄͳ¼ÆÐÅÏ¢£¬¸ÃÊý×éµÄ¸ñʽÏêϸ˵Ã÷ÓÚÊÖ²áÖÐ + <function>stat</function> Ò³ÃæÀï¡£ </para> - + <para> + <example> + <title><function>fstat</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// ´ò¿ªÎļþ +$fp = fopen("/etc/passwd", "r"); + +// È¡µÃͳ¼ÆÐÅÏ¢ +$fstat = fstat($fp); + +// ¹Ø±ÕÎļþ +fclose($fp); + +// Ö»ÏÔʾ¹ØÁªÊý×鲿·Ö +print_r(array_slice($fstat, 13)); + +?> +]]> + </programlisting> + <para> + Êä³öÀàËÆÓÚ£º + </para> + <screen> +<![CDATA[ +Array +( + [dev] => 771 + [ino] => 488704 + [mode] => 33188 + [nlink] => 1 + [uid] => 0 + [gid] => 0 + [rdev] => 0 + [size] => 1114 + [atime] => 1061067181 + [mtime] => 1056136526 + [ctime] => 1056136526 + [blksize] => 4096 + [blocks] => 8 +) +]]> + </screen> + </example> + </para> + ¬e.clearstatcache; - + ¬e.no-remote; </refsect1> Index: phpdoc-zh/reference/filesystem/functions/ftell.xml diff -u phpdoc-zh/reference/filesystem/functions/ftell.xml:1.3 phpdoc-zh/reference/filesystem/functions/ftell.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/ftell.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/ftell.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.ftell"> <refnamediv> <refname>ftell</refname> @@ -23,7 +23,28 @@ ÎļþÖ¸Õë±ØÐëÊÇÓÐЧµÄ£¬ÇÒ±ØÐëÖ¸ÏòÒ»¸öͨ¹ý <function>fopen</function> »ò <function>popen</function> ³É¹¦´ò¿ªµÄÎļþ¡£ </para> - <para> + <para> + <example> + <title><function>ftell</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// ´ò¿ªÎļþ²¢¶ÁЩÊý¾Ý +$fp = fopen("/etc/passwd", "r"); +$data = fgets($fp, 12); + +// ÏÖÔÚÖ¸Õëµ½ÄÄÀïÁË£¿ +echo ftell($fp); // 11 + +fclose($fp); + +?> +]]> + </programlisting> + </example> + </para> + <para> ²Î¼û <function>fopen</function>£¬<function>popen</function>£¬<function>fseek</function> ºÍ <function>rewind</function>¡£ Index: phpdoc-zh/reference/filesystem/functions/ftruncate.xml diff -u phpdoc-zh/reference/filesystem/functions/ftruncate.xml:1.3 phpdoc-zh/reference/filesystem/functions/ftruncate.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/ftruncate.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/ftruncate.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.ftruncate"> <refnamediv> <refname>ftruncate</refname> @@ -17,6 +17,16 @@ <para> ½ÓÊÜÎļþÖ¸Õë <parameter>handle</parameter> ×÷Ϊ²ÎÊý£¬²¢½«Îļþ´óС½ØÈ¡Îª <parameter>size</parameter>¡£&return.success; + </para> + <note> + <para> + ÔÚ PHP 4.3.3 ֮ǰ£¬<function>ftruncate</function> Ôڳɹ¦Ê±·µ»ØÒ»¸ö + <type>integer</type> Öµ 1£¬¶ø²»ÊÇ <type>boolean</type> µÄ &true;¡£ + </para> + </note> + <para> + ²Î¼û <function>fopen</function> + ºÍ <function>fseek</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/glob.xml diff -u phpdoc-zh/reference/filesystem/functions/glob.xml:1.3 phpdoc-zh/reference/filesystem/functions/glob.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/glob.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/glob.xml Mon Aug 18 19:23:46 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> <refentry id="function.glob"> <refnamediv> - <refname>glob</refname> + <refname>glob</refname> <refpurpose>ѰÕÒÓëģʽƥÅäµÄÎļþ·¾¶</refpurpose> </refnamediv> <refsect1> @@ -58,7 +58,8 @@ </para> <note> <simpara> - <constant>GLOB_ONLYDIR</constant> ²»¿ÉÓÃÓÚ Windows Ï¡£ + ÔÚ PHP 4.3.3 ֮ǰ£¬<constant>GLOB_ONLYDIR</constant> + <emphasis role="strong">²»¿É</emphasis>ÓÃÓÚ Windows ÏÂÒÔ¼°ÆäËü²»Ê¹Óà GNU C ¿âµÄϵͳ¡£ </simpara> </note> <para> @@ -85,9 +86,9 @@ </programlisting> </example> </para> - + ¬e.no-remote; - + <para> ²Î¼û <function>opendir</function>£¬<function>readdir</function>£¬<function>closedir</function> Index: phpdoc-zh/reference/filesystem/functions/is-executable.xml diff -u phpdoc-zh/reference/filesystem/functions/is-executable.xml:1.3 phpdoc-zh/reference/filesystem/functions/is-executable.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/is-executable.xml:1.3 Wed Apr 23 19:58:53 2003 +++ phpdoc-zh/reference/filesystem/functions/is-executable.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> <refentry id="function.is-executable"> <refnamediv> <refname>is_executable</refname> @@ -16,16 +16,37 @@ <para> Èç¹ûÎļþ´æÔÚÇÒ¿ÉÖ´ÐÐÔò·µ»Ø &true;¡£ </para> - - ¬e.no-windows; - + <para> + <function>is_executable</function> ×Ô PHP 5.0.0 °æÆð¿ÉÓÃÓÚ Windows¡£ + </para> + <para> + <example> + <title><function>is_executable</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$file = '/home/vincent/somefile.sh'; + +if(is_executable($file)) { + echo $file.' is executable'; +} else { + echo $file.' is not executable'; +} + +?> +]]> + </programlisting> + </example> + </para> + ¬e.clearstatcache; ¬e.no-remote; <para> - ²Î¼û <function>is_file</function> ºÍ - <function>is_link</function>¡£ + ²Î¼û <function>is_file</function> + ºÍ <function>is_link</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/link.xml diff -u phpdoc-zh/reference/filesystem/functions/link.xml:1.3 phpdoc-zh/reference/filesystem/functions/link.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/link.xml:1.3 Wed Apr 23 20:07:31 2003 +++ phpdoc-zh/reference/filesystem/functions/link.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.link"> <refnamediv> <refname>link</refname> @@ -10,14 +10,14 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>link</methodname> + <type>bool</type><methodname>link</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>string</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> - <function>link</function> ½¨Á¢Ò»¸öÓ²Á¬½Ó¡£ + <function>link</function> ½¨Á¢Ò»¸öÓ²Á¬½Ó¡£&return.success; </para> - + ¬e.no-remote; <para> Index: phpdoc-zh/reference/filesystem/functions/linkinfo.xml diff -u phpdoc-zh/reference/filesystem/functions/linkinfo.xml:1.3 phpdoc-zh/reference/filesystem/functions/linkinfo.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/linkinfo.xml:1.3 Wed Apr 23 20:07:31 2003 +++ phpdoc-zh/reference/filesystem/functions/linkinfo.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.linkinfo"> <refnamediv> <refname>linkinfo</refname> @@ -19,6 +19,20 @@ ×ֶΡ£±¾º¯ÊýÓÃÀ´ÑéÖ¤Ò»¸öÁ¬½Ó£¨ÓÉ <parameter>path</parameter> ËùÖ¸ÏòµÄ£©ÊÇ·ñȷʵ´æÔÚ£¨Ê¹Óà stat.h ÖÐµÄ S_ISLNK ºêͬÑùµÄ·½·¨£©¡£Èç¹û³ö´íÔò·µ»Ø 0 »ò &false;¡£ + </para> + <para> + <example> + <title><function>linkinfo</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo linkinfo('/vmlinuz'); // 835 + +?> +]]> + </programlisting> + </example> </para> <para> ²Î¼û Index: phpdoc-zh/reference/filesystem/functions/mkdir.xml diff -u phpdoc-zh/reference/filesystem/functions/mkdir.xml:1.3 phpdoc-zh/reference/filesystem/functions/mkdir.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/mkdir.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/mkdir.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.mkdir"> <refnamediv> <refname>mkdir</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>mkdir</methodname> + <type>bool</type><methodname>mkdir</methodname> <methodparam><type>string</type><parameter>pathname</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> </methodsynopsis> @@ -34,7 +34,9 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php mkdir ("/path/to/my/dir", 0700); +?> ]]> </programlisting> </informalexample> Index: phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml diff -u phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml:1.3 phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/parse-ini-file.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.14 Maintainer: dallas Status: ready --> <refentry id="function.parse-ini-file"> <refnamediv> <refname>parse_ini_file</refname> @@ -41,7 +41,7 @@ </note> <note> <simpara> - ÓÐЩ±£Áô×Ö²»ÄÜ×÷Ϊ ini ÎļþÖеļüÃû£¬°üÀ¨£ºyes£¬no£¬true ºÍ false¡£ + ÓÐЩ±£Áô×Ö²»ÄÜ×÷Ϊ ini ÎļþÖеļüÃû£¬°üÀ¨£ºnull£¬yes£¬no£¬true ºÍ false¡£ </simpara> </note> <para> @@ -93,12 +93,10 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - Would produce: - <informalexample> - <programlisting> + <para> + ½«Êä³ö£º + </para> + <screen> <![CDATA[ Array ( @@ -125,8 +123,8 @@ ) ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/pathinfo.xml diff -u phpdoc-zh/reference/filesystem/functions/pathinfo.xml:1.3 phpdoc-zh/reference/filesystem/functions/pathinfo.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/pathinfo.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/pathinfo.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> @@ -34,19 +34,17 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - ½«Êä³ö£º - <informalexample> - <programlisting> + <para> + ½«Êä³ö£º + </para> + <screen> <![CDATA[ /www/htdocs index.html html ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> <note> <para> Index: phpdoc-zh/reference/filesystem/functions/popen.xml diff -u phpdoc-zh/reference/filesystem/functions/popen.xml:1.3 phpdoc-zh/reference/filesystem/functions/popen.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/popen.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/popen.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.popen"> <refnamediv> <refname>popen</refname> @@ -14,10 +14,10 @@ <methodparam><type>string</type><parameter>command</parameter></methodparam> <methodparam><type>string</type><parameter>mode</parameter></methodparam> </methodsynopsis> - <para> + <para> ´ò¿ªÒ»¸öÖ¸Ïò½ø³ÌµÄ¹ÜµÀ£¬¸Ã½ø³ÌÓÉÅÉÉú¸ø¶¨µÄ <parameter>command</parameter> ÃüÁîÖ´Ðжø²úÉú¡£ </para> - <para> + <para> ·µ»ØÒ»¸öºÍ <function>fopen</function> Ëù·µ»ØµÄÏàͬµÄÎļþÖ¸Õ룬ֻ²»¹ýËüÊǵ¥ÏòµÄ£¨Ö»ÄÜÓÃÓÚ¶Á»òд£©²¢ÇÒ±ØÐëÓà <function>pclose</function> À´¹Ø±Õ¡£´ËÖ¸Õë¿ÉÒÔÓÃÓÚ Index: phpdoc-zh/reference/filesystem/functions/readlink.xml diff -u phpdoc-zh/reference/filesystem/functions/readlink.xml:1.3 phpdoc-zh/reference/filesystem/functions/readlink.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/readlink.xml:1.3 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/readlink.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.readlink"> <refnamediv> <refname>readlink</refname> @@ -16,6 +16,21 @@ <para> <function>readlink</function> ºÍͬÃûµÄ C º¯Êý×öͬÑùµÄÊ£¬·µ»Ø·ûºÅÁ¬½ÓµÄÄÚÈÝ¡£Èç¹û³ö´í·µ»Ø 0¡£ + </para> + <para> + <example> + <title><function>readlink</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// output e.g. /boot/vmlinux-2.4.20-xfs +echo readlink('/vmlinuz'); + +?> +]]> + </programlisting> + </example> </para> <para> ²Î¼û <function>is_link</function>£¬<function>symlink</function> ºÍ Index: phpdoc-zh/reference/filesystem/functions/realpath.xml diff -u phpdoc-zh/reference/filesystem/functions/realpath.xml:1.3 phpdoc-zh/reference/filesystem/functions/realpath.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/realpath.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/realpath.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.realpath"> <refnamediv> <refname>realpath</refname> @@ -27,7 +27,9 @@ <title><function>realpath</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $real_path = realpath ("../../index.php"); +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/rename.xml diff -u phpdoc-zh/reference/filesystem/functions/rename.xml:1.4 phpdoc-zh/reference/filesystem/functions/rename.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/rename.xml:1.4 Fri Feb 28 03:30:53 2003 +++ phpdoc-zh/reference/filesystem/functions/rename.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: lm92 Status: ready --> <refentry id="function.rename"> <refnamediv> <refname>rename</refname> @@ -14,22 +14,34 @@ <methodparam><type>string</type><parameter>oldname</parameter></methodparam> <methodparam><type>string</type><parameter>newname</parameter></methodparam> </methodsynopsis> - <para> + <para> ³¢ÊÔ°Ñ <parameter>oldname</parameter> ÖØÃüÃûΪ <parameter>newname</parameter>¡£ - </para> - <para> + </para> + <para> &return.success; - <example> - <title><function>rename</function> Àý×Ó </title> - <programlisting role="php"> + </para> + <para> + <example> + <title><function>rename</function> Àý×Ó </title> + <programlisting role="php"> <![CDATA[ <?php - rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); +rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); ?> ]]> - </programlisting> - </example> + </programlisting> + </example> + </para> + <note> + <para> + ÔÚ PHP 4.3.3 ֮ǰ£¬<function>rename</function> ²»ÄÜÔÚ»ùÓÚ + *nix µÄϵͳÖпç´ÅÅÌ·ÖÇøÖØÃüÃûÎļþ¡£ + </para> + </note> + <para> + ²Î¼û <function>copy</function>£¬<function>unlink</function> + ºÍ <function>move_uploaded_file</function>¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/filesystem/functions/rewind.xml diff -u phpdoc-zh/reference/filesystem/functions/rewind.xml:1.3 phpdoc-zh/reference/filesystem/functions/rewind.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/rewind.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/rewind.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> <refentry id="function.rewind"> <refnamediv> <refname>rewind</refname> @@ -10,14 +10,14 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>rewind</methodname> + <type>bool</type><methodname>rewind</methodname> <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> - <para> + <para> ½« <parameter>handle</parameter> µÄÎļþλÖÃÖ¸ÕëÉèΪÎļþÁ÷µÄ¿ªÍ·¡£ - </para> - <para> - Èç¹û³ö´í·µ»Ø 0£¬·ñÔò·µ»Ø 1¡£ + </para> + <para> + &return.success; </para> <para> ÎļþÖ¸Õë±ØÐëºÏ·¨£¬²¢ÇÒÖ¸ÏòÓÉ <function>fopen</function> Index: phpdoc-zh/reference/filesystem/functions/rmdir.xml diff -u phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.5 phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.5 Fri Feb 28 03:22:08 2003 +++ phpdoc-zh/reference/filesystem/functions/rmdir.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: lm92 Status: ready --> <refentry id="function.rmdir"> <refnamediv> <refname>rmdir</refname> @@ -10,14 +10,13 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>rmdir</methodname> + <type>bool</type><methodname>rmdir</methodname> <methodparam><type>string</type><parameter>dirname</parameter></methodparam> </methodsynopsis> - <para> + <para> ³¢ÊÔɾ³ý <parameter>dirname</parameter> ËùÖ¸¶¨µÄĿ¼¡£ - ¸ÃĿ¼±ØÐëÊǿյ쬶øÇÒÒªÓÐÏàÓ¦µÄȨÏÞ¡£ - &return.success; - </para> + ¸ÃĿ¼±ØÐëÊǿյ쬶øÇÒÒªÓÐÏàÓ¦µÄȨÏÞ¡£&return.success; + </para> <para> ²Î¼û <function>mkdir</function> ºÍ <function>unlink</function>¡£ </para> Index: phpdoc-zh/reference/filesystem/functions/stat.xml diff -u phpdoc-zh/reference/filesystem/functions/stat.xml:1.4 phpdoc-zh/reference/filesystem/functions/stat.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/stat.xml:1.4 Mon May 12 01:23:50 2003 +++ phpdoc-zh/reference/filesystem/functions/stat.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> <refentry id="function.stat"> <refnamediv> <refname>stat</refname> @@ -23,83 +23,98 @@ Èç¹û³ö´í£¬<function>stat</function> ·µ»Ø &false;£¬²¢ÇÒ·¢³öÒ»Ìõ¾¯¸æ¡£ </para> <para> - ·µ»ØÒ»¸öÊý×é°üº¬ÓÐÎļþµÄͳ¼ÆÐÅÏ¢£¬¸ÃÊý×é¾ßÓÐÒÔÏÂÁгöµÄµ¥Ôª£¬Êý×éϱê´ÓÁ㿪ʼ¡£³ýÁËÊý×ÖË÷ÒýÖ®Íâ×Ô PHP 4.0.6 Æð»¹¿ÉÒÔͨ¹ý¹ØÁªË÷ÒýÀ´·ÃÎÊ¡£ - <itemizedlist> - <listitem> - <simpara> - 0 : device - É豸Ãû£¨Ò²¿Éͨ¹ý <literal>dev</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 1 : inode - ½ÚµãºÅ£¨Ò²¿Éͨ¹ý <literal>ino</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 2 : inode protection mode - ½Úµã±£»¤Ä£Ê½£¨Ò²¿Éͨ¹ý <literal>mode</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 3 : number of links - ±»Á¬½ÓµÄÊýÄ¿£¨Ò²¿Éͨ¹ý <literal>nlink</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 4 : user id of owner - ËùÓÐÕßµÄÓû§ ID£¨Ò²¿Éͨ¹ý <literal>uid</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 5 : group id owner - ËùÓÐÕßµÄ×é ID£¨Ò²¿Éͨ¹ý <literal>gid</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 6 : device type if inode device - inode É豸ÀàÐÍ£¨Ò²¿Éͨ¹ý <literal>rdev</literal> ·ÃÎÊ£©* - </simpara> - </listitem> - <listitem> - <simpara> - 7 : size in bytes - ×Ö½ÚÊý£¨Ò²¿Éͨ¹ý <literal>size</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 8 : time of last access - ÎļþÉϴα»·ÃÎʵÄʱ¼ä£¨Ò²¿Éͨ¹ý <literal>atime</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 9 : time of last modification - ÎļþÄÚÈÝÉϴα»Ð޸ĵÄʱ¼ä£¨Ò²¿Éͨ¹ý <literal>mtime</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 10 : time of last change - Îļþ״̬Éϴα»¸Ä±äµÄʱ¼ä£¨Ò²¿Éͨ¹ý <literal>ctime</literal> ·ÃÎÊ£© - </simpara> - </listitem> - <listitem> - <simpara> - 11 : blocksize for filesystem I/O - ÎļþϵͳÖеĿé´óС£¨Ò²¿Éͨ¹ý <literal>blksize</literal> ·ÃÎÊ£©* - </simpara> - </listitem> - <listitem> - <simpara> - 12 : number of blocks allocated - ËùÕ¼ÓÿéµÄÊýÄ¿£¨Ò²¿Éͨ¹ý <literal>blocks</literal> ·ÃÎÊ£© - </simpara> - </listitem> - </itemizedlist> + ·µ»ØÒ»¸öÊý×é°üº¬ÓÐÎļþµÄͳ¼ÆÐÅÏ¢£¬¸ÃÊý×é¾ßÓÐÒÔÏÂÁгöµÄµ¥Ôª£¬Êý×éϱê´ÓÁ㿪ʼ¡£³ýÁËÊý×ÖË÷ÒýÖ®Íâ×Ô + PHP 4.0.6 Æð»¹¿ÉÒÔͨ¹ý¹ØÁªË÷ÒýÀ´·ÃÎÊ¡£ + </para> + <para> + <table> + <title><function>stat</function> ºÍ <function>fstat</function> ·µ»Ø¸ñʽ</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Êý×Öϱê</entry> + <entry>¹ØÁª¼üÃû£¨×Ô PHP 4.0.6£©</entry> + <entry>˵Ã÷</entry> + </row> + </thead> + <tbody> + <row> + <entry>0</entry> + <entry>dev</entry> + <entry>device number - É豸Ãû</entry> + </row> + <row> + <entry>1</entry> + <entry>ino</entry> + <entry>inode number - inode ºÅÂë</entry> + </row> + <row> + <entry>2</entry> + <entry>mode</entry> + <entry>inode protection mode - inode ±£»¤Ä£Ê½</entry> + </row> + <row> + <entry>3</entry> + <entry>nlink</entry> + <entry>number of links - ±»Á¬½ÓÊýÄ¿</entry> + </row> + <row> + <entry>4</entry> + <entry>uid</entry> + <entry>userid of owner - ËùÓÐÕßµÄÓû§id</entry> + </row> + <row> + <entry>5</entry> + <entry>gid</entry> + <entry>groupid of owner- ËùÓÐÕßµÄ×é id</entry> + </row> + <row> + <entry>6</entry> + <entry>rdev</entry> + <entry>device type, if inode device * - É豸ÀàÐÍ£¬Èç¹ûÊÇ inode É豸µÄ»°</entry> + </row> + <row> + <entry>7</entry> + <entry>size</entry> + <entry>size in bytes - Îļþ´óСµÄ×Ö½ÚÊý</entry> + </row> + <row> + <entry>8</entry> + <entry>atime</entry> + <entry>time of last access (unix timestamp) - ÉϴηÃÎÊʱ¼ä£¨Unix ʱ¼ä´Á£©</entry> + </row> + <row> + <entry>9</entry> + <entry>mtime</entry> + <entry>time of last modification (unix timestamp) - ÉÏ´ÎÐÞ¸Äʱ¼ä£¨Unix ʱ¼ä´Á£©</entry> + </row> + <row> + <entry>10</entry> + <entry>ctime</entry> + <entry>time of last change (unix timestamp) - Éϴθıäʱ¼ä£¨Unix ʱ¼ä´Á£©</entry> + </row> + <row> + <entry>11</entry> + <entry>blksize</entry> + <entry>blocksize of filesystem IO * - Îļþϵͳ IO µÄ¿é´óС</entry> + </row> + <row> + <entry>12</entry> + <entry>blocks</entry> + <entry>number of blocks allocated - ËùÕ¼¾Ý¿éµÄÊýÄ¿</entry> + </row> + </tbody> + </tgroup> + </table> * - ½öÔÚÖ§³Ö st_blksize ÀàÐ͵ÄϵͳÏÂÓÐЧ¡£ÆäËüϵͳ£¨Èç Windows£©·µ»Ø -1¡£ </para> - + ¬e.clearstatcache; - + ¬e.no-remote; - + <para> - ²Î¼û <function>lstat</function>£¬<function>filemtime</function> ºÍ + ²Î¼û <function>lstat</function>£¬<function>fstat</function>£¬<function>filemtime</function> ºÍ <function>filegroup</function>¡£ </para> </refsect1> Index: phpdoc-zh/reference/filesystem/functions/symlink.xml diff -u phpdoc-zh/reference/filesystem/functions/symlink.xml:1.3 phpdoc-zh/reference/filesystem/functions/symlink.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/symlink.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/symlink.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.symlink"> <refnamediv> <refname>symlink</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>symlink</methodname> + <type>bool</type><methodname>symlink</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>string</type><parameter>link</parameter></methodparam> </methodsynopsis> @@ -18,6 +18,9 @@ <function>symlink</function> ¶ÔÓÚÒÑÓÐµÄ <parameter>target</parameter> ½¨Á¢Ò»¸öÃûΪ <parameter>link</parameter> µÄ·ûºÅÁ¬½Ó¡£ + </para> + <para> + &return.success; </para> <para> ²Î¼û <function>link</function> À´½¨Á¢Ó²Á¬½Ó£¬ÒÔ¼° Index: phpdoc-zh/reference/filesystem/functions/tempnam.xml diff -u phpdoc-zh/reference/filesystem/functions/tempnam.xml:1.3 phpdoc-zh/reference/filesystem/functions/tempnam.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/tempnam.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/tempnam.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> @@ -27,21 +27,26 @@ ²ÎÊý£¬Èç¹ûÆäÖ¸ÏòµÄĿ¼´æÔڵϰ¡£Èç¹ûÓÐÒÉÎÊÇë²Î¿¼ÏµÍ³ÎĵµÖÐµÄ tempnam(3) º¯Êý¡£ </para> + <note> + <simpara> + Èç¹û PHP ²»ÄÜÔÚÖ¸¶¨µÄ <parameter>dir</parameter> + ²ÎÊýÖд´½¨Îļþ£¬ÔòÍ˻ص½ÏµÍ³Ä¬ÈÏÖµ¡£ + </simpara> + </note> <para> ·µ»ØÐµÄÁÙʱÎļþÃû£¬³ö´í·µ»Ø &false; ×Ö·û´®¡£ <example> <title><function>tempnam</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $tmpfname = tempnam ("/tmp", "FOO"); - $handle = fopen($tmpfname, "w"); fwrite($handle, "writing to tempfile"); fclose($handle); - // do here something - unlink($tmpfname); +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/tmpfile.xml diff -u phpdoc-zh/reference/filesystem/functions/tmpfile.xml:1.3 phpdoc-zh/reference/filesystem/functions/tmpfile.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/tmpfile.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/tmpfile.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> @@ -28,9 +28,11 @@ <title><function>tmpfile</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $temp = tmpfile(); fwrite($temp, "writing to tempfile"); fclose($temp); // this removes the file +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/touch.xml diff -u phpdoc-zh/reference/filesystem/functions/touch.xml:1.3 phpdoc-zh/reference/filesystem/functions/touch.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/touch.xml:1.3 Wed Apr 23 23:50:33 2003 +++ phpdoc-zh/reference/filesystem/functions/touch.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> <refentry id="function.touch"> <refnamediv> <refname>touch</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>touch</methodname> + <type>bool</type><methodname>touch</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>time</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>atime</parameter></methodparam> @@ -24,20 +24,21 @@ <parameter>atime</parameter>¡£×¢Òâ·ÃÎÊʱ¼ä×ÜÊǻᱻÐ޸ĵ쬲»ÂÛÓм¸¸ö²ÎÊý¡£ </para> <para> - Èç¹ûÎļþ²»´æÔÚ£¬Ôò»á±»´´½¨¡£ + Èç¹ûÎļþ²»´æÔÚ£¬Ôò»á±»´´½¨¡£&return.success; </para> <para> - &return.success; <example> <title><function>touch</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php if (touch ($FileName)) { - print "$FileName modification time has been + print "$FileName modification time has been changed to todays date and time"; } else { print "Sorry Could Not change modification time of $FileName"; } +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/unlink.xml diff -u phpdoc-zh/reference/filesystem/functions/unlink.xml:1.5 phpdoc-zh/reference/filesystem/functions/unlink.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/unlink.xml:1.5 Thu May 15 15:45:59 2003 +++ phpdoc-zh/reference/filesystem/functions/unlink.xml Mon Aug 18 19:23:46 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: lm92 Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: lm92 Status: ready --> <!-- CREDITS: dallas --> <refentry id="function.unlink"> <refnamediv> @@ -10,16 +10,13 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>unlink</methodname> - <methodparam><type>string</type><parameter>filename</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>unlink</methodname> + <methodparam><type>string</type><parameter>filename</parameter></methodparam> + </methodsynopsis> <para> ɾ³ý <parameter>filename</parameter>¡£ºÍ Unix C µÄ - unlink() º¯ÊýÏàËÆ¡£ - </para> - <para> - &return.success; + unlink() º¯ÊýÏàËÆ¡£&return.success; </para> <note> <simpara>