CVS update: php3/doc/functions

From: Date: Mon, 07 Sep 1998 11:55:37 +0000
Subject: CVS update: php3/doc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-860@lists.php.net to get a copy of this message
Date: Monday September 7, 1998 @ 7:55 Author: cslawi Update of /repository/php3/doc/functions In directory asf:/u2/tmp/cvs-serv14500/functions Modified Files: filesystem.sgml Log Message: Listed fopen() modes; added a link from fpassthru() to readfile(). Index: php3/doc/functions/filesystem.sgml diff -c php3/doc/functions/filesystem.sgml:1.26 php3/doc/functions/filesystem.sgml:1.27 *** php3/doc/functions/filesystem.sgml:1.26 Sun Sep 6 02:50:21 1998 --- php3/doc/functions/filesystem.sgml Mon Sep 7 07:55:36 1998 *************** *** 595,631 **** <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>string <parameter>mode</parameter></paramdef> </funcsynopsis> ! <para> If <parameter>filename</parameter> begins with "http://" (not case sensitive), an HTTP 1.0 connection is opened to the specified server and a file pointer is returned to the beginning of the text of the response. ! <para> Does not handle HTTP redirects, so you must include trailing slashes on directories. ! <para> If <parameter>filename</parameter> begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened and a pointer to the requested file is returned. If the server does not support passive mode ftp, this will fail. ! <para> If <parameter>filename</parameter> begins with anything else, the file will be opened from the filesystem, and a file pointer to the file opened is returned. ! <para> If the open fails, the function returns false. ! <para><example> <title>fopen() example</title> <programlisting> $fp = fopen( "/home/rasmus/file.txt", "r" ); $fp = fopen( "http://www.php.net/", "r" ); </programlisting></example> ! <para> See also <function>fclose</function>, <function>fsockopen</function>, and <function>popen</function>. --- 595,668 ---- <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>string <parameter>mode</parameter></paramdef> </funcsynopsis> ! <simpara> If <parameter>filename</parameter> begins with "http://" (not case sensitive), an HTTP 1.0 connection is opened to the specified server and a file pointer is returned to the beginning of the text of the response. ! <simpara> Does not handle HTTP redirects, so you must include trailing slashes on directories. ! <simpara> If <parameter>filename</parameter> begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened and a pointer to the requested file is returned. If the server does not support passive mode ftp, this will fail. ! <simpara> If <parameter>filename</parameter> begins with anything else, the file will be opened from the filesystem, and a file pointer to the file opened is returned. ! <simpara> If the open fails, the function returns false. + + <para> + <parameter>mode</parameter> may be any of the following: + <itemizedlist> + <listitem><simpara>'r' - Open for reading only; place the file + pointer at the beginning of the file. + <listitem><simpara> + 'r+' - Open for reading and writing; place the file pointer at + the beginning of the file. + <listitem><simpara> + 'w' - Open for writing only; place the file pointer at the + beginning of the file and truncate the file to zero length. + If the file does not exist, attempt to create it. + <listitem><simpara> + 'w+' - Open for reading and writing; place the file pointer at + the beginning of the file and truncate the file to zero length. + If the file does not exist, attempt to create it. + <listitem><simpara> + 'a' - Open for writing only; place the file pointer at the end + of the file. If the file does not exist, attempt to create it. + <listitem><simpara> + 'a+' - Open for reading and writing; place the file pointer at + the end of the file. If the file does not exist, attempt to + create it. + </itemizedlist> + + As well, <parameter>mode</parameter> may contain the letter + 'b'. This is useful only on systems which differentiate between + binary and text files (i.e., it's useless on Unix). If not + needed, this will be ignored. ! <para> ! <example> <title>fopen() example</title> <programlisting> $fp = fopen( "/home/rasmus/file.txt", "r" ); $fp = fopen( "http://www.php.net/", "r" ); </programlisting></example> ! <simpara> ! If you are experiencing problems with reading and writing to ! files and you're using the server module version of PHP, remember ! to make sure that the files and directories you're using are ! accessible to the server process. ! ! <simpara> See also <function>fclose</function>, <function>fsockopen</function>, and <function>popen</function>. *************** *** 644,666 **** <funcdef>int <function>fpassthru</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> </funcsynopsis> ! <para> Reads to EOF on the given file pointer and writes the results to standard output. ! <para> If an error occurs, <function>fpassthru</function> returns false. ! <para> The file pointer must be valid, and must point to a file successfully opened by <function>fopen</function>, <function>popen</function>, or <function>fsockopen</function>. ! <para> The file is closed when <function>fpassthru</function> is done reading it (leaving <parameter>fp</parameter> useless). </refsect1> </refentry> --- 681,707 ---- <funcdef>int <function>fpassthru</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> </funcsynopsis> ! <simpara> Reads to EOF on the given file pointer and writes the results to standard output. ! <simpara> If an error occurs, <function>fpassthru</function> returns false. ! <simpara> The file pointer must be valid, and must point to a file successfully opened by <function>fopen</function>, <function>popen</function>, or <function>fsockopen</function>. ! <simpara> The file is closed when <function>fpassthru</function> is done reading it (leaving <parameter>fp</parameter> useless). + <simpara> + See also <function>readfile</function>, <function>fopen</function>, + <function>popen</function>, and <function>fsockopen</function> + </refsect1> </refentry> -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#860) next »