cvs: phpdoc-zh /reference/filesystem/functions fgets.xml
| From: | Dallas Thunder | Date: | Mon, 19 Sep 2005 16:22:46 +0000 |
| Subject: | cvs: phpdoc-zh /reference/filesystem/functions fgets.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2665@lists.php.net to get a copy of this message | ||
dallas Mon Sep 19 12:22:46 2005 EDT
Modified files:
/phpdoc-zh/reference/filesystem/functions fgets.xml
Log:
Updated.
http://cvs.php.net/diff.php/phpdoc-zh/reference/filesystem/functions/fgets.xml?r1=1.7&r2=1.8&ty=u
Index: phpdoc-zh/reference/filesystem/functions/fgets.xml
diff -u phpdoc-zh/reference/filesystem/functions/fgets.xml:1.7
phpdoc-zh/reference/filesystem/functions/fgets.xml:1.8
--- phpdoc-zh/reference/filesystem/functions/fgets.xml:1.7 Tue Aug 16 01:50:27 2005
+++ phpdoc-zh/reference/filesystem/functions/fgets.xml Mon Sep 19 12:22:46 2005
@@ -1,75 +1,77 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.7 $ -->
-<!-- $Author: lm92 $ -->
-<!-- EN-Revision: 1.13 Maintainer: dallas Status: ready -->
- <refentry id="function.fgets">
- <refnamediv>
- <refname>fgets</refname>
- <refpurpose>´ÓÎļþÖ¸ÕëÖжÁȡһÐÐ</refpurpose>
- </refnamediv>
- <refsect1>
- <title>˵Ã÷</title>
- <methodsynopsis>
- <type>string</type><methodname>fgets</methodname>
-
<methodparam><type>int</type><parameter>handle</parameter></methodparam>
- <methodparam
choice="opt"><type>int</type><parameter>length</parameter></methodparam>
- </methodsynopsis>
- <para>
- ´Ó <parameter>handle</parameter>
- Ö¸ÏòµÄÎļþÖжÁȡһÐв¢·µ»Ø³¤¶È×î¶àΪ
<parameter>length</parameter> - 1
- ×Ö½ÚµÄ×Ö·û´®¡£Åöµ½»»Ðзû£¨°üÀ¨ÔÚ·µ»ØÖµÖУ©¡¢EOF
»òÕßÒѾ¶ÁÈ¡ÁË length - 1
- ×Ö½ÚºóÍ£Ö¹£¨¿´ÏÈÅöµ½ÄÇÒ»ÖÖÇé¿ö£©¡£Èç¹ûûÓÐÖ¸¶¨
- <parameter>length</parameter>£¬ÔòĬÈÏΪ 1K£¬»òÕß˵ 1024
×Ö½Ú¡£
- </para>
- <para>
- ³ö´íʱ·µ»Ø &false;¡£
- </para>
- <para>
- ͨ³£µÄȱÏÝ£º
- </para>
- <simpara>
- ϰ¹ßÁË C ÓïÑÔÖÐ <function>fgets</function>
Óï·¨µÄÈËÓ¦¸Ã×¢Òâµ½ <literal>EOF</literal>
- ÊÇÔõÑù±»·µ»ØµÄ¡£
- </simpara>
- &fs.validfp.all;
- <para>
- ÒÔÏÂÊÇÒ»¸ö¼òµ¥Àý×Ó£º
- <example>
- <title>ÖðÐжÁÈ¡Îļþ</title>
- <programlisting role="php">
+<!-- $Revision: 1.8 $ -->
+<!-- $Author: dallas $ -->
+<!-- EN-Revision: 1.15 Maintainer: dallas Status: ready -->
+<refentry id="function.fgets">
+ <refnamediv>
+ <refname>fgets</refname>
+ <refpurpose>´ÓÎļþÖ¸ÕëÖжÁȡһÐÐ</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>˵Ã÷</title>
+ <methodsynopsis>
+ <type>string</type><methodname>fgets</methodname>
+
<methodparam><type>int</type><parameter>handle</parameter></methodparam>
+ <methodparam
choice="opt"><type>int</type><parameter>length</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ ´Ó <parameter>handle</parameter>
+ Ö¸ÏòµÄÎļþÖжÁȡһÐв¢·µ»Ø³¤¶È×î¶àΪ
<parameter>length</parameter> - 1
+ ×Ö½ÚµÄ×Ö·û´®¡£Åöµ½»»Ðзû£¨°üÀ¨ÔÚ·µ»ØÖµÖУ©¡¢EOF
»òÕßÒѾ¶ÁÈ¡ÁË length - 1
+ ×Ö½ÚºóÍ£Ö¹£¨¿´ÏÈÅöµ½ÄÇÒ»ÖÖÇé¿ö£©¡£Èç¹ûûÓÐÖ¸¶¨
+ <parameter>length</parameter>£¬ÔòĬÈÏΪ 1K£¬»òÕß˵ 1024
×Ö½Ú¡£
+ </para>
+ <para>
+ ³ö´íʱ·µ»Ø &false;¡£
+ </para>
+ <para>
+ ͨ³£µÄȱÏÝ£º
+ </para>
+ <simpara>
+ ϰ¹ßÁË C ÓïÑÔÖÐ <function>fgets</function>
Óï·¨µÄÈËÓ¦¸Ã×¢Òâµ½ <literal>EOF</literal>
+ ÊÇÔõÑù±»·µ»ØµÄ¡£
+ </simpara>
+ &fs.validfp.all;
+ <para>
+ ÒÔÏÂÊÇÒ»¸ö¼òµ¥Àý×Ó£º
+ <example>
+ <title>ÖðÐжÁÈ¡Îļþ</title>
+ <programlisting role="php">
<![CDATA[
<?php
-$handle = fopen("/tmp/inputfile.txt", "r");
-while (!feof($handle)) {
- $buffer = fgets($fd, 4096);
- echo $buffer;
+$handle = @fopen("/tmp/inputfile.txt", "r");
+if ($handle) {
+ while (!feof($handle)) {
+ $buffer = fgets($fd, 4096);
+ echo $buffer;
+ }
+ fclose($handle);
}
-fclose($handle);
?>
]]>
- </programlisting>
- </example>
- </para>
- <note>
- <simpara>
- <parameter>length</parameter> ²ÎÊý´Ó PHP 4.2.0
- Æð³ÉΪ¿ÉÑ¡ÏÈç¹ûºöÂÔ£¬ÔòÐеij¤¶È±»¼Ù¶¨Îª
1024¡£´Ó PHP 4.3 ¿ªÊ¼£¬ºöÂÔµô
- <parameter>length</parameter>
½«¼ÌÐø´ÓÁ÷ÖжÁÈ¡Êý¾ÝÖ±µ½ÐнáÊø¡£Èç¹ûÎļþÖеĴó¶àÊýÐж¼´óÓÚ
-
8KB£¬ÔòÔڽű¾ÖÐÖ¸¶¨×î´óÐеij¤¶ÈÔÚÀûÓÃ×ÊÔ´ÉϸüΪÓÐЧ¡£
- </simpara>
- </note>
- <note>
- <simpara>
- ´Ó PHP 4.3
¿ªÊ¼±¾º¯Êý¿ÉÒÔ°²È«ÓÃÓÚ¶þ½øÖÆÎļþ¡£ÔçÆÚµÄ°æ±¾Ôò²»ÐС£
- </simpara>
- </note>
- ¬e.line-endings;
- <para>
- ²Î¼û
<function>fread</function>£¬<function>fgetc</function>£¬<function>stream_get_line</function>£¬<function>fopen</function>£¬<function>popen</function>£¬<function>fsockopen</function>
- ºÍ <function>stream_set_timeout</function>¡£
- </para>
- </refsect1>
- </refentry>
+ </programlisting>
+ </example>
+ </para>
+ <note>
+ <simpara>
+ <parameter>length</parameter> ²ÎÊý´Ó PHP 4.2.0
+ Æð³ÉΪ¿ÉÑ¡ÏÈç¹ûºöÂÔ£¬ÔòÐеij¤¶È±»¼Ù¶¨Îª
1024¡£´Ó PHP 4.3 ¿ªÊ¼£¬ºöÂÔµô
+ <parameter>length</parameter>
½«¼ÌÐø´ÓÁ÷ÖжÁÈ¡Êý¾ÝÖ±µ½ÐнáÊø¡£Èç¹ûÎļþÖеĴó¶àÊýÐж¼´óÓÚ
+
8KB£¬ÔòÔڽű¾ÖÐÖ¸¶¨×î´óÐеij¤¶ÈÔÚÀûÓÃ×ÊÔ´ÉϸüΪÓÐЧ¡£
+ </simpara>
+ </note>
+ <note>
+ <simpara>
+ ´Ó PHP 4.3
¿ªÊ¼±¾º¯Êý¿ÉÒÔ°²È«ÓÃÓÚ¶þ½øÖÆÎļþ¡£ÔçÆÚµÄ°æ±¾Ôò²»ÐС£
+ </simpara>
+ </note>
+ ¬e.line-endings;
+ <para>
+ ²Î¼û
<function>fgetss</function>£¬<function>fread</function>£¬<function>fgetc</function>£¬<function>stream_get_line</function>£¬<function>fopen</function>£¬<function>popen</function>£¬<function>fsockopen</function>
+ ºÍ <function>stream_set_timeout</function>¡£
+ </para>
+ </refsect1>
+</refentry>
<!-- Keep this comment at the end of the file
Local variables: