cvs: phpdoc-zh /reference/filesystem/functions basename.xml chgrp.xml chmod.xml chown.xml copy.xml dirname.xml fgetc.xml fgets.xml file-exists.xml
file-get-contents.xml file-put-contents.xml file.xml fileatime.xml filectime.xml filesize.xml filetype.xml

From: Date: Mon, 18 Aug 2003 20:51:03 +0000
Subject: cvs: phpdoc-zh /reference/filesystem/functions basename.xml chgrp.xml chmod.xml chown.xml copy.xml dirname.xml fgetc.xml fgets.xml file-exists.xml
file-get-contents.xml file-put-contents.xml file.xml fileatime.xml filectime.xml filesize.xml filetype.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1637@lists.php.net to get a copy of this message
dallas Mon Aug 18 16:51:03 2003 EDT Modified files: /phpdoc-zh/reference/filesystem/functions basename.xml chgrp.xml chmod.xml chown.xml copy.xml dirname.xml fgetc.xml fgets.xml file-exists.xml file-get-contents.xml file-put-contents.xml file.xml fileatime.xml filectime.xml filesize.xml filetype.xml Log: Updated.

Index: phpdoc-zh/reference/filesystem/functions/basename.xml diff -u phpdoc-zh/reference/filesystem/functions/basename.xml:1.2 phpdoc-zh/reference/filesystem/functions/basename.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/basename.xml:1.2 Sun Sep 29 22:54:17 2002 +++ phpdoc-zh/reference/filesystem/functions/basename.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.basename"> <refnamediv> <refname>basename</refname> @@ -26,9 +26,11 @@ <title><function>basename</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $path = "/home/httpd/html/index.php"; $file = basename ($path); // $file is set to "index.php" $file = basename ($path,".php"); // $file is set to "index" +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/chgrp.xml diff -u phpdoc-zh/reference/filesystem/functions/chgrp.xml:1.2 phpdoc-zh/reference/filesystem/functions/chgrp.xml:1.3 --- phpdoc-zh/reference/filesystem/functions/chgrp.xml:1.2 Sun Sep 29 22:54:17 2002 +++ phpdoc-zh/reference/filesystem/functions/chgrp.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.chgrp"> <refnamediv> <refname>chgrp</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>chgrp</methodname> + <type>bool</type><methodname>chgrp</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam><type>mixed</type><parameter>group</parameter></methodparam> </methodsynopsis> Index: phpdoc-zh/reference/filesystem/functions/chmod.xml diff -u phpdoc-zh/reference/filesystem/functions/chmod.xml:1.3 phpdoc-zh/reference/filesystem/functions/chmod.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/chmod.xml:1.3 Mon Feb 24 04:11:53 2003 +++ phpdoc-zh/reference/filesystem/functions/chmod.xml Mon Aug 18 16:51:02 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.chmod"> <refnamediv> <refname>chmod</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>chmod</methodname> + <type>bool</type><methodname>chmod</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam><type>int</type><parameter>mode</parameter></methodparam> </methodsynopsis> @@ -21,6 +21,8 @@ <para> ×¢Òâ <parameter>mode</parameter> ²»»á±»×Ô¶¯µ±³É°Ë½øÖÆÊýÖµ£¬¶øÇÒÒ²²»ÄÜÓÃ×Ö·û´®£¨ÀýÈç "g+w"£©¡£ÒªÈ·±£ÕýÈ·²Ù×÷£¬ÐèÒª¸ø <parameter>mode</parameter> Ç°Ãæ¼ÓÉÏ 0£º + </para> + <para> <informalexample> <programlisting role="php"> <![CDATA[ @@ -36,8 +38,10 @@ <para> <parameter>mode</parameter> ²ÎÊý°üº¬Èý¸ö°Ë½øÖÆÊý°´Ë³Ðò·Ö±ðÖ¸¶¨ÁËËùÓÐÕß¡¢ËùÓÐÕßËùÔÚµÄ×éÒÔ¼°ËùÓÐÈ˵ķÃÎÊÏÞÖÆ¡£Ã¿Ò»²¿·Ö¶¼¿ÉÒÔͨ¹ý¼ÓÈëËùÐèµÄȨÏÞÀ´¼ÆËã³öËùÒªµÄȨÏÞ¡£Êý×Ö 1 ±íʾʹÎļþ¿ÉÖ´ÐУ¬Êý×Ö 2 ±íʾʹÎļþ¿Éд£¬Êý×Ö 4 - ±íʾʹÎļþ¿É¶Á¡£¼ÓÈëÕâЩÊý×ÖÀ´Öƶ¨ËùÐèÒªµÄȨÏÞ¡£ÓÐ¹Ø UNIX ϵͳµÄÎļþȨÏÞ¿ÉÒÔÔĶÁÊֲᡰman 1 + ±íʾʹÎļþ¿É¶Á¡£¼ÓÈëÕâЩÊý×ÖÀ´Öƶ¨ËùÐèÒªµÄȨÏÞ¡£ÓÐ¹Ø UNIX ϵͳµÄÎļþȨÏÞ¿ÉÒÔÔĶÁÊֲᡰman 1 chmod¡±ºÍ¡°man 2 chmod¡±¡£ + </para> + <para> <informalexample> <programlisting role="php"> <![CDATA[ @@ -59,15 +63,13 @@ </informalexample> </para> <para> - <note> - <para> - µ±Ç°Óû§Ö¸µÄÊÇÖ´ÐÐ PHP µÄÓû§¡£ºÜ¿ÉÄܺÍͨ³£µÄ shell »òÕß FTP Óû§²»ÊÇͬһ¸ö¡£ - </para> - </note> - </para> - <para> &return.success; </para> + <note> + <para> + µ±Ç°Óû§Ö¸µÄÊÇÖ´ÐÐ PHP µÄÓû§¡£ºÜ¿ÉÄܺÍͨ³£µÄ shell »òÕß FTP Óû§²»ÊÇͬһ¸ö¡£ + </para> + </note> &note.no-remote; <para> ²Î¼û <function>chown</function> ºÍ <function>chgrp</function>¡£ Index: phpdoc-zh/reference/filesystem/functions/chown.xml diff -u phpdoc-zh/reference/filesystem/functions/chown.xml:1.3 phpdoc-zh/reference/filesystem/functions/chown.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/chown.xml:1.3 Mon Feb 24 04:12:14 2003 +++ phpdoc-zh/reference/filesystem/functions/chown.xml Mon Aug 18 16:51:02 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.chown"> <refnamediv> <refname>chown</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>chown</methodname> + <type>bool</type><methodname>chown</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam><type>mixed</type><parameter>user</parameter></methodparam> </methodsynopsis> Index: phpdoc-zh/reference/filesystem/functions/copy.xml diff -u phpdoc-zh/reference/filesystem/functions/copy.xml:1.4 phpdoc-zh/reference/filesystem/functions/copy.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/copy.xml:1.4 Mon Feb 24 04:12:19 2003 +++ phpdoc-zh/reference/filesystem/functions/copy.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.copy"> <refnamediv> <refname>copy</refname> @@ -10,7 +10,7 @@ <refsect1> <title>˵Ã÷</title> <methodsynopsis> - <type>int</type><methodname>copy</methodname> + <type>bool</type><methodname>copy</methodname> <methodparam><type>string</type><parameter>source</parameter></methodparam> <methodparam><type>string</type><parameter>dest</parameter></methodparam> </methodsynopsis> @@ -20,9 +20,11 @@ <title><function>copy</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php if (!copy($file, $file.'.bak')) { print ("failed to copy $file...<br>\n"); } +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/dirname.xml diff -u phpdoc-zh/reference/filesystem/functions/dirname.xml:1.3 phpdoc-zh/reference/filesystem/functions/dirname.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/dirname.xml:1.3 Mon Feb 24 04:12:20 2003 +++ phpdoc-zh/reference/filesystem/functions/dirname.xml Mon Aug 18 16:51:02 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.dirname"> <refnamediv> <refname>dirname</refname> @@ -24,8 +24,10 @@ <title><function>dirname</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php $path = "/etc/passwd"; $file = dirname ($path); // $file is set to "/etc" +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/filesystem/functions/fgetc.xml diff -u phpdoc-zh/reference/filesystem/functions/fgetc.xml:1.4 phpdoc-zh/reference/filesystem/functions/fgetc.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/fgetc.xml:1.4 Mon Feb 24 04:12:24 2003 +++ phpdoc-zh/reference/filesystem/functions/fgetc.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.fgetc"> <refnamediv> <refname>fgetc</refname> @@ -22,14 +22,27 @@ <function>fopen</function>£¬<function>popen</function> »ò <function>fsockopen</function> ³É¹¦´ò¿ªµÄ¡£ </para> + &return.falseproblem; <para> - <note> - <para> - ±¾º¯Êý¿É°²È«ÓÃÓÚ¶þ½øÖÆÎļþ¡£ - </para> - </note> + <example> + <title><function>fgetc</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php +$fp = fopen('somefile.txt', 'r'); +if (!$fp) { + echo 'Could not open file somefile.txt'; +} +while (false !== ($char = fgetc($fp))) { + echo "$char\n"; +} +?> +]]> + </programlisting> + </example> </para> - <para> + &note.bin-safe; + <para> ²Î¼û <function>fread</function>£¬<function>fopen</function>£¬<function>popen</function>£¬<function>fsockopen</function> ºÍ <function>fgets</function>¡£ </para> Index: phpdoc-zh/reference/filesystem/functions/fgets.xml diff -u phpdoc-zh/reference/filesystem/functions/fgets.xml:1.5 phpdoc-zh/reference/filesystem/functions/fgets.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/fgets.xml:1.5 Fri Apr 4 01:13:07 2003 +++ phpdoc-zh/reference/filesystem/functions/fgets.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.fgets"> <refnamediv> <refname>fgets</refname> @@ -36,16 +36,18 @@ </simpara> <para> ÒÔÏÂÊÇÒ»¸ö¼òµ¥Àý×Ó£º - <example> + <example> <title>ÖðÐжÁÈ¡Îļþ</title> <programlisting role="php"> <![CDATA[ +<?php $handle = fopen ("/tmp/inputfile.txt", "r"); while (!feof ($handle)) { $buffer = fgets($fd, 4096); echo $buffer; } fclose ($handle); +?> ]]> </programlisting> </example> @@ -64,7 +66,7 @@ </simpara> </note> &note.line-endings; - <para> + <para> ²Î¼û <function>fread</function>£¬<function>fgetc</function>£¬<function>stream_get_line</function>£¬<function>fopen</function>£¬<function>popen</function>£¬<function>fsockopen</function> ºÍ <function>socket_set_timeout</function>¡£ </para> Index: phpdoc-zh/reference/filesystem/functions/file-exists.xml diff -u phpdoc-zh/reference/filesystem/functions/file-exists.xml:1.5 phpdoc-zh/reference/filesystem/functions/file-exists.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/file-exists.xml:1.5 Tue Mar 4 04:34:41 2003 +++ phpdoc-zh/reference/filesystem/functions/file-exists.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: dallas Status: ready --> <refentry id="function.file-exists"> <refnamediv> <refname>file_exists</refname> @@ -9,21 +9,18 @@ </refnamediv> <refsect1> <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>file_exists</methodname> - <methodparam><type>string</type><parameter>filename</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>file_exists</methodname> + <methodparam><type>string</type><parameter>filename</parameter></methodparam> + </methodsynopsis> <simpara> Èç¹ûÓÉ <parameter>filename</parameter> Ö¸¶¨µÄÎļþ»òĿ¼´æÔÚÔò·µ»Ø &true;£¬·ñÔò·µ»Ø &false;¡£ </simpara> - <note> - <title>ʹÓà Windows ¹²Ïí</title> - <para> -ÔÚ Windows ÖÐÒªÓà <filename>//computername/share/filename</filename> »òÕß -<filename>\\computername\share\filename</filename> À´¼ì²éÍøÂçÖеĹ²ÏíÎļþ¡£ - </para> - </note> + <para> + ÔÚ Windows ÖÐÒªÓà <filename>//computername/share/filename</filename> »òÕß + <filename>\\computername\share\filename</filename> À´¼ì²éÍøÂçÖеĹ²ÏíÎļþ¡£ + </para> <para> <example> <title>²âÊÔÒ»¸öÎļþÊÇ·ñ´æÔÚ</title> @@ -42,11 +39,11 @@ </programlisting> </example> </para> - + &note.clearstatcache; - + &note.no-remote; - + <para> ²Î¼û <function>is_readable</function>£¬<function>is_writable</function>£¬<function>is_file</function> ºÍ <function>file</function>¡£ </para> Index: phpdoc-zh/reference/filesystem/functions/file-get-contents.xml diff -u phpdoc-zh/reference/filesystem/functions/file-get-contents.xml:1.4 phpdoc-zh/reference/filesystem/functions/file-get-contents.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/file-get-contents.xml:1.4 Sun Apr 20 02:35:00 2003 +++ phpdoc-zh/reference/filesystem/functions/file-get-contents.xml Mon Aug 18 16:51:02 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: dallas Status: ready --> <refentry id="function.file-get-contents"> <refnamediv> - <refname>file_get_contents</refname> + <refname>file_get_contents</refname> <refpurpose>½«Õû¸öÎļþ¶ÁÈëÒ»¸ö×Ö·û´®</refpurpose> </refnamediv> <refsect1> @@ -15,15 +15,19 @@ <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> - <para> + <para> ºÍ <function>file</function> Ò»Ñù£¬Ö»³ýÁË <function>file_get_contents</function> ½«Îļþ·µ»ØÎªÒ»¸ö×Ö·û´®¡£ </para> + <para> + <function>file_get_contents</function> + º¯ÊýÊÇÓÃÀ´½«ÎļþµÄÄÚÈݶÁÈëµ½Ò»¸ö×Ö·û´®ÖеÄÊ×Ñ¡·½·¨¡£Èç¹û²Ù×÷ϵͳ֧³Ö»¹»áʹÓÃÄÚ´æÓ³Éä¼¼ÊõÀ´ÔöÇ¿ÐÔÄÜ¡£ + </para> &note.bin-safe; &tip.fopen-wrapper; <note> <simpara> - Context Ö§³ÖÊÇ <literal>PHP 5.0</literal> мӵġ£ + Context Ö§³ÖÊÇ <literal>PHP 5.0.0</literal> мӵġ£ </simpara> </note> <simpara> Index: phpdoc-zh/reference/filesystem/functions/file-put-contents.xml diff -u phpdoc-zh/reference/filesystem/functions/file-put-contents.xml:1.1 phpdoc-zh/reference/filesystem/functions/file-put-contents.xml:1.2 --- phpdoc-zh/reference/filesystem/functions/file-put-contents.xml:1.1 Wed Apr 23 21:37:31 2003 +++ phpdoc-zh/reference/filesystem/functions/file-put-contents.xml Mon Aug 18 16:51:02 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.file-put-contents"> <refnamediv> - <refname>file_put_contents</refname> + <refname>file_put_contents</refname> <refpurpose>½«Ò»¸ö×Ö·û´®Ð´ÈëÎļþ</refpurpose> </refnamediv> <refsect1> @@ -16,9 +16,9 @@ <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> - <simpara> - ºÍ³É¹¦µ÷Óà <function>fopen</function>£¬<function>fwrite</function> - ºÍ <function>fclose</function> ¹¦ÄÜÒ»Ñù¡£ + <simpara> + ºÍÒÀ´Îµ÷Óà <function>fopen</function>£¬<function>fwrite</function> + ÒÔ¼° <function>fclose</function> ¹¦ÄÜÒ»Ñù¡£±¾º¯Êý·µ»ØÐ´ÈëÎļþµÄ×Ö½ÚÊý¡£ </simpara> <simpara> <parameter>flags</parameter> ¿ÉÒÔÊÇ <constant>FILE_USE_INCLUDE_PATH</constant> Index: phpdoc-zh/reference/filesystem/functions/file.xml diff -u phpdoc-zh/reference/filesystem/functions/file.xml:1.5 phpdoc-zh/reference/filesystem/functions/file.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/file.xml:1.5 Sun Apr 20 02:35:00 2003 +++ phpdoc-zh/reference/filesystem/functions/file.xml Mon Aug 18 16:51:02 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.8 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: dallas Status: ready --> <refentry id="function.file"> <refnamediv> - <refname>file</refname> + <refname>file</refname> <refpurpose>°ÑÕû¸öÎļþ¶ÁÈëÒ»¸öÊý×éÖÐ</refpurpose> </refnamediv> <refsect1> @@ -15,18 +15,11 @@ <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> - <para> + <para> ºÍ <function>readfile</function> Ò»Ñù£¬Ö»³ýÁË <function>file</function> ½«Îļþ×÷Ϊһ¸öÊý×é·µ»Ø¡£Êý×éÖеÄÿ¸öµ¥Ôª¶¼ÊÇÎļþÖÐÏàÓ¦µÄÒ»ÐУ¬°üÀ¨»»ÐзûÔÚÄÚ¡£Èç¹ûʧ°Ü <function>file</function> ·µ»Ø &false;¡£ </para> - <note> - <para> - ·µ»ØµÄÊý×éÖÐÿһÐж¼°üÀ¨ÁËÐнáÊø·û£¬Òò´ËÈç¹û²»ÐèÒªÐнáÊø·ûʱ»¹ÐèҪʹÓà - <function>trim</function> º¯Êý¡£ - </para> - </note> - &note.line-endings; <para> Èç¹ûÒ²ÏëÔÚ <link linkend="ini.include-path">include_path</link> ÖÐËÑѰÎļþµÄ»°£¬¿ÉÒÔ½«¿ÉÑ¡²ÎÊý <parameter>use_include_path</parameter> ÉèΪ "1"¡£ @@ -48,6 +41,14 @@ ]]> </programlisting> </informalexample> + &tip.fopen-wrapper; + <note> + <para> + ·µ»ØµÄÊý×éÖÐÿһÐж¼°üÀ¨ÁËÐнáÊø·û£¬Òò´ËÈç¹û²»ÐèÒªÐнáÊø·ûʱ»¹ÐèҪʹÓà + <function>trim</function> º¯Êý¡£ + </para> + </note> + &note.line-endings; </para> <note> <para> @@ -58,8 +59,12 @@ ´Ó PHP 4.3.0 ¿ªÊ¼ <function>file</function> ¿ÉÒÔ°²È«ÓÃÓÚ¶þ½øÖÆÎļþ¡£ </para> </note> - &tip.fopen-wrapper; - <para> + <note> + <simpara> + Context Ö§³ÖÊÇ <literal>PHP 5.0.0</literal> мӵġ£ + </simpara> + </note> + <para> ²Î¼û <function>readfile</function>£¬<function>fopen</function>£¬<function>fsockopen</function>£¬<function>popen</function>£¬<function>file_get_contents</function> ºÍ <function>include</function>¡£ </para> Index: phpdoc-zh/reference/filesystem/functions/fileatime.xml diff -u phpdoc-zh/reference/filesystem/functions/fileatime.xml:1.3 phpdoc-zh/reference/filesystem/functions/fileatime.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/fileatime.xml:1.3 Mon Feb 24 04:12:27 2003 +++ phpdoc-zh/reference/filesystem/functions/fileatime.xml Mon Aug 18 16:51:02 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.fileatime"> <refnamediv> <refname>fileatime</refname> @@ -13,7 +13,7 @@ <type>int</type><methodname>fileatime</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> - <simpara> + <simpara> ·µ»ØÎļþÉϴα»·ÃÎʵÄʱ¼ä£¬Èç¹û³ö´íÔò·µ»Ø &false;¡£Ê±¼äÒÔ Unix ʱ¼ä´ÁµÄ·½Ê½·µ»Ø¡£ </simpara> <simpara> @@ -22,11 +22,27 @@ Unix Îļþϵͳ¿ÉÒÔÔÚ¼ÓÔØÊ±¹Ø±Õ atime µÄ¸üÐÂÒÔÌá¸ßÕâÀà³ÌÐòµÄÐÔÄÜ¡£USENET ÐÂÎÅ×é¼ÙÍÑ»úÊÇÒ»¸ö³£¼ûµÄÀý×Ó¡£ÔÚÕâÖÖÎļþϵͳϱ¾º¯ÊýûÓÐÓô¦¡£ </simpara> - &note.clearstatcache; - &note.no-remote; - + <para> + <example> + <title><function>fileatime</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Êä³öÀàËÆ£ºsomefile.txt was last accessed: December 29 2002 22:16:23. + +$filename = 'somefile.txt'; +if (file_exists($filename)) { + echo "$filename was last accessed: " . date ("F d Y H:i:s.", fileatime($filename)); +} + +?> +]]> + </programlisting> + </example> + </para> <simpara> ²Î¼û <function>filemtime</function>£¬<function>fileinode</function> ºÍ <function>date</function>¡£ </simpara> Index: phpdoc-zh/reference/filesystem/functions/filectime.xml diff -u phpdoc-zh/reference/filesystem/functions/filectime.xml:1.3 phpdoc-zh/reference/filesystem/functions/filectime.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/filectime.xml:1.3 Mon Feb 24 04:12:27 2003 +++ phpdoc-zh/reference/filesystem/functions/filectime.xml Mon Aug 18 16:51:02 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.filectime"> <refnamediv> <refname>filectime</refname> @@ -19,7 +19,7 @@ <para> ×¢Ò⣺ÔÚ´ó¶àÊý Unix ÎļþϵͳÖУ¬µ±Ò»¸öÎļþµÄ inode Êý¾Ý±»¸Ä±äʱÔò¸ÃÎļþ±»ÈÏΪÊÇÐÞ¸ÄÁË¡£Ò²¾ÍÊÇ˵£¬µ±ÎļþµÄȨÏÞ£¬ËùÓÐÕߣ¬ËùÓÐ×é»òÆäËü - inode ÖеÄÔªÊý¾Ý±»¸üÐÂʱ¡£²Î¼û + inode ÖеÄÔªÊý¾Ý±»¸üÐÂʱ¡£²Î¼û <function>filemtime</function>£¨Õâ²ÅÊÇÄãÏëÓÃÓÚÔÚ web Ò³ÃæÖн¨Á¢¡°×îºó¸üÐÂʱ¼ä¡±½Å×¢µÄº¯Êý£©ºÍ <function>fileatime</function>¡£ </para> @@ -27,11 +27,29 @@ ×¢ÒâijЩ Unix ˵Ã÷Îı¾ÖÐ°Ñ ctime ˵³ÉÊǸÃÎļþ½¨Á¢µÄʱ¼ä£¬ÕâÊÇ´íµÄ¡£ÔÚ´ó¶àÊý Unix ÎļþϵͳÖÐûÓÐ Unix ÎļþµÄ½¨Á¢Ê±¼ä¡£ </para> - + &note.clearstatcache; - + &note.no-remote; - + <para> + <example> + <title><function>fileatime</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Êä³öÀàËÆ£ºsomefile.txt was last changed: December 29 2002 22:16:23. + +$filename = 'somefile.txt'; +if (file_exists($filename)) { + echo "$filename was last changed: " . date ("F d Y H:i:s.", filectime($filename)); +} + +?> +]]> + </programlisting> + </example> + </para> <simpara> ²Î¼û <function>filemtime</function>¡£ </simpara> Index: phpdoc-zh/reference/filesystem/functions/filesize.xml diff -u phpdoc-zh/reference/filesystem/functions/filesize.xml:1.3 phpdoc-zh/reference/filesystem/functions/filesize.xml:1.4 --- phpdoc-zh/reference/filesystem/functions/filesize.xml:1.3 Mon Feb 24 04:12:30 2003 +++ phpdoc-zh/reference/filesystem/functions/filesize.xml Mon Aug 18 16:51:02 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.filesize"> <refnamediv> <refname>filesize</refname> @@ -13,11 +13,37 @@ <type>int</type><methodname>filesize</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> - <para> + <para> ·µ»ØÎļþ´óСµÄ×Ö½ÚÊý£¬Èç¹û³ö´í·µ»Ø &false;¡£ </para> + <note> + <simpara> + ÒòΪ PHP µÄÕûÊýÀàÐÍÊÇÓзûºÅµÄ£¬²¢ÇÒ´ó¶àÊýƽ̨ʹÓà 32 + λÕûÊý£¬<function>filesize</function> º¯ÊýÔÚÅöµ½´óÓÚ 2GB + µÄÎļþʱ¿ÉÄܻ᷵»Ø·ÇÔ¤ÆÚµÄ½á¹û¡£¶ÔÓÚ 2GB µ½ 4GB + Ö®¼äµÄÎļþͨ³£¿ÉÒÔʹÓà + <literal>sprintf("%u", filesize($file))</literal> À´¿Ë·þ´ËÎÊÌâ¡£ + </simpara> + </note> &note.clearstatcache; &note.no-remote; + <para> + <example> + <title><function>filesize</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Êä³öÀàËÆ£ºsomefile.txt: 1024 bytes + +$filename = 'somefile.txt'; +echo $filename . ': ' . filesize($filename) . ' bytes'; + +?> +]]> + </programlisting> + </example> + </para> <simpara> ²Î¼û <function>file_exists</function>¡£ </simpara> Index: phpdoc-zh/reference/filesystem/functions/filetype.xml diff -u phpdoc-zh/reference/filesystem/functions/filetype.xml:1.4 phpdoc-zh/reference/filesystem/functions/filetype.xml:1.5 --- phpdoc-zh/reference/filesystem/functions/filetype.xml:1.4 Mon Feb 24 04:12:31 2003 +++ phpdoc-zh/reference/filesystem/functions/filetype.xml Mon Aug 18 16:51:02 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.filetype"> <refnamediv> <refname>filetype</refname> @@ -13,7 +13,7 @@ <type>string</type><methodname>filetype</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> - <para> + <para> ·µ»ØÎļþµÄÀàÐÍ¡£¿ÉÄܵÄÖµÓÐ fifo£¬char£¬dir£¬block£¬link£¬file ºÍ unknown¡£ </para> @@ -23,10 +23,25 @@ </para> &note.clearstatcache; &note.no-remote; + <para> + <example> + <title><function>filetype</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo filetype('/etc/passwd'); // file +echo filetype('/etc/'); // dir + +?> +]]> + </programlisting> + </example> + </para> <simpara> ²Î¼û - <function>is_dir</function>£¬<function>is_file</function>£¬<function>is_link</function>£¬<function>file_exists</function> - ºÍ <function>stat</function>¡£ + <function>is_dir</function>£¬<function>is_file</function>£¬<function>is_link</function>£¬<function>file_exists</function>£¬<function>stat</function> + ºÍ <function>mime_content_type</function>¡£ </simpara> </refsect1> </refentry>
« previous php.doc.zh (#1637) next »