mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Use 'handle' instead of 'fp' in parameter declarations and examples.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@111625 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
be3dfeb106
commit
9c4ae88f49
22 changed files with 86 additions and 86 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fclose">
|
||||
<refnamediv>
|
||||
|
@ -10,10 +10,10 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>fclose</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The file pointed to by <parameter>fp</parameter> is closed.
|
||||
The file pointed to by <parameter>handle</parameter> is closed.
|
||||
</para>
|
||||
<para>
|
||||
&return.success;
|
||||
|
@ -30,9 +30,9 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$fp = fopen('somefile.txt', 'r');
|
||||
$handle = fopen('somefile.txt', 'r');
|
||||
|
||||
fclose($fp);
|
||||
fclose($handle);
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.feof">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>feof</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns &true; if the file pointer is at EOF or an error occurs;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.43 -->
|
||||
<refentry id="function.fflush">
|
||||
<refnamediv>
|
||||
|
@ -10,11 +10,11 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>fflush</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function forces a write of all buffered output to the
|
||||
resource pointed to by the file handle <parameter>fp</parameter>.
|
||||
resource pointed to by the file handle <parameter>handle</parameter>.
|
||||
Returns &true; if successful, &false; otherwise.
|
||||
</para>
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fgetc">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fgetc</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns a string containing a single character read from the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fgetcsv">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fgetcsv</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>delimiter</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>enclosure</parameter></methodparam>
|
||||
|
@ -31,7 +31,7 @@
|
|||
</simpara>
|
||||
</note>
|
||||
<simpara>
|
||||
The <parameter>fp</parameter> parameter must be a valid file pointer to a file
|
||||
The <parameter>handle</parameter> parameter must be a valid file pointer to a file
|
||||
successfully opened by <function>fopen</function>,
|
||||
<function>popen</function>, or <function>fsockopen</function>.
|
||||
</simpara>
|
||||
|
@ -57,8 +57,8 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
$row = 1;
|
||||
$fp = fopen ("test.csv","r");
|
||||
while ($data = fgetcsv ($fp, 1000, ",")) {
|
||||
$handle = fopen ("test.csv","r");
|
||||
while ($data = fgetcsv ($handle, 1000, ",")) {
|
||||
$num = count ($data);
|
||||
print "<p> $num fields in line $row: <br>\n";
|
||||
$row++;
|
||||
|
@ -66,7 +66,7 @@ while ($data = fgetcsv ($fp, 1000, ",")) {
|
|||
print $data[$c] . "<br>\n";
|
||||
}
|
||||
}
|
||||
fclose ($fp);
|
||||
fclose ($handle);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fgets">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fgets</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -42,12 +42,12 @@
|
|||
<title>Reading a file line by line</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
$fd = fopen ("/tmp/inputfile.txt", "r");
|
||||
while (!feof ($fd)) {
|
||||
$buffer = fgets($fd, 4096);
|
||||
$handle = fopen ("/tmp/inputfile.txt", "r");
|
||||
while (!feof ($handle)) {
|
||||
$buffer = fgets($handle, 4096);
|
||||
echo $buffer;
|
||||
}
|
||||
fclose ($fd);
|
||||
fclose ($handle);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fgetss">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fgetss</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>allowable_tags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.flock">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>flock</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>operation</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>&wouldblock</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
@ -20,7 +20,7 @@
|
|||
same way of locking or it will not work).
|
||||
</simpara>
|
||||
<simpara>
|
||||
<function>flock</function> operates on <parameter>fp</parameter>
|
||||
<function>flock</function> operates on <parameter>handle</parameter>
|
||||
which must be an open file
|
||||
pointer. <parameter>operation</parameter> is one of the following
|
||||
values:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fopen">
|
||||
<refnamediv>
|
||||
|
@ -121,10 +121,10 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$fp = fopen ("/home/rasmus/file.txt", "r");
|
||||
$fp = fopen ("/home/rasmus/file.gif", "wb");
|
||||
$fp = fopen ("http://www.example.com/", "r");
|
||||
$fp = fopen ("ftp://user:password@example.com/", "w");
|
||||
$handle = fopen ("/home/rasmus/file.txt", "r");
|
||||
$handle = fopen ("/home/rasmus/file.gif", "wb");
|
||||
$handle = fopen ("http://www.example.com/", "r");
|
||||
$handle = fopen ("ftp://user:password@example.com/", "w");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -143,7 +143,7 @@ $fp = fopen ("ftp://user:password@example.com/", "w");
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$fp = fopen ("c:\\data\\info.txt", "r");
|
||||
$handle = fopen ("c:\\data\\info.txt", "r");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fpassthru">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>fpassthru</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
Reads to EOF on the given file pointer from the current position and
|
||||
|
@ -19,7 +19,7 @@
|
|||
<simpara>
|
||||
If an error occurs, <function>fpassthru</function> returns
|
||||
&false;. Otherwise, <function>fpassthru</function> returns
|
||||
the number of characters read from <parameter>fp</parameter>
|
||||
the number of characters read from <parameter>handle</parameter>
|
||||
and passed through to the output.
|
||||
</simpara>
|
||||
<simpara>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<function>rewind</function> to reset the file pointer to the beginning of
|
||||
the file if you have already written data to the file. The file is
|
||||
closed when <function>fpassthru</function> is done reading it (leaving
|
||||
<parameter>fp</parameter> useless).
|
||||
<parameter>handle</parameter> useless).
|
||||
</simpara>
|
||||
<simpara>
|
||||
If you just want to dump the contents of a file to the output buffer,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fputs">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>fputs</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.25 -->
|
||||
<refentry id="function.fread">
|
||||
<refnamediv>
|
||||
|
@ -10,13 +10,13 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fread</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
<function>fread</function> reads up to
|
||||
<parameter>length</parameter> bytes from the file pointer
|
||||
referenced by <parameter>fp</parameter>. Reading stops when
|
||||
referenced by <parameter>handle</parameter>. Reading stops when
|
||||
<parameter>length</parameter> bytes have been read or EOF
|
||||
(end of file) reached, whichever comes first.
|
||||
</simpara>
|
||||
|
@ -27,9 +27,9 @@
|
|||
<?php
|
||||
// get contents of a file into a string
|
||||
$filename = "/usr/local/something.txt";
|
||||
$fd = fopen ($filename, "r");
|
||||
$contents = fread ($fd, filesize ($filename));
|
||||
fclose ($fd);
|
||||
$handle = fopen ($filename, "r");
|
||||
$contents = fread ($handle, filesize ($filename));
|
||||
fclose ($handle);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -48,9 +48,9 @@ fclose ($fd);
|
|||
<![CDATA[
|
||||
<?php
|
||||
$filename = "c:\\files\\somepic.gif";
|
||||
$fd = fopen ($filename, "rb");
|
||||
$contents = fread ($fd, filesize ($filename));
|
||||
fclose ($fd);
|
||||
$handle = fopen ($filename, "rb");
|
||||
$contents = fread ($handle, filesize ($filename));
|
||||
fclose ($handle);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fscanf">
|
||||
<refnamediv>
|
||||
|
@ -10,14 +10,14 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>fscanf</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>var1</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function <function>fscanf</function> is similar to
|
||||
<function>sscanf</function>, but it takes its input from a file
|
||||
associated with <parameter>fp</parameter> and interprets the
|
||||
associated with <parameter>handle</parameter> and interprets the
|
||||
input according to the specified
|
||||
<parameter>format</parameter>. If only two parameters were passed
|
||||
to this function, the values parsed will be returned as an array.
|
||||
|
@ -35,12 +35,12 @@
|
|||
<title><function>fscanf</function> Example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
$fp = fopen ("users.txt","r");
|
||||
while ($userinfo = fscanf ($fp, "%s\t%s\t%s\n")) {
|
||||
$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($fp);
|
||||
fclose($handle);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fseek">
|
||||
<refnamediv>
|
||||
|
@ -10,13 +10,13 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>fseek</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<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>
|
||||
Sets the file position indicator for the file referenced by
|
||||
<parameter>fp</parameter>.The new position, measured in bytes
|
||||
<parameter>handle</parameter>.The new position, measured in bytes
|
||||
from the beginning of the file, is obtained by adding
|
||||
<parameter>offset</parameter> to the position specified by
|
||||
<parameter>whence</parameter>, whose values are defined as
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.24 -->
|
||||
<refentry id="function.fstat">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>fstat</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gathers the statistics of the file opened by the file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.ftell">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>ftell</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the position of the file pointer referenced by fp; i.e.,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.14 -->
|
||||
<refentry id="function.ftruncate">
|
||||
<refnamediv>
|
||||
|
@ -10,11 +10,11 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ftruncate</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>size</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Takes the filepointer, <parameter>fp</parameter>, and truncates the file to
|
||||
Takes the filepointer, <parameter>handle</parameter>, and truncates the file to
|
||||
length, <parameter>size</parameter>. This function returns &true; on
|
||||
success and &false; on failure.
|
||||
</para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.fwrite">
|
||||
<refnamediv>
|
||||
|
@ -10,14 +10,14 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>fwrite</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
<function>fwrite</function> writes the contents of
|
||||
<parameter>string</parameter> to the file stream pointed to by
|
||||
<parameter>fp</parameter>. If the <parameter>length</parameter>
|
||||
<parameter>handle</parameter>. If the <parameter>length</parameter>
|
||||
argument is given, writing will stop after
|
||||
<parameter>length</parameter> bytes have been written or the end
|
||||
of <parameter>string</parameter> is reached, whichever comes
|
||||
|
@ -56,20 +56,20 @@ if (is_writable($filename)) {
|
|||
// In our example we're opening $filename in append mode.
|
||||
// The file pointer is at the bottom of the file hence
|
||||
// that's where $somecontent will go when we fwrite() it.
|
||||
if (!$fp = fopen($filename, 'a')) {
|
||||
if (!$handle = fopen($filename, 'a')) {
|
||||
print "Cannot open file ($filename)";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Write $somecontent to our opened file.
|
||||
if (!fwrite($fp, $somecontent)) {
|
||||
if (!fwrite($handle, $somecontent)) {
|
||||
print "Cannot write to file ($filename)";
|
||||
exit;
|
||||
}
|
||||
|
||||
print "Success, wrote ($somecontent) to file ($filename)";
|
||||
|
||||
fclose($fp);
|
||||
fclose($handle);
|
||||
|
||||
} else {
|
||||
print "The file $filename is not writable";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pclose">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>pclose</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Closes a file pointer to a pipe opened by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.popen">
|
||||
<refnamediv>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$fp = popen ("/bin/ls", "r");
|
||||
$handle = popen ("/bin/ls", "r");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -57,11 +57,11 @@ $fp = popen ("/bin/ls", "r");
|
|||
error_reporting(E_ALL);
|
||||
|
||||
/* Add redirection so we can get stderr. */
|
||||
$fp = popen('/path/to/spooge 2>&1', 'r');
|
||||
echo "'$fp'; " . gettype($fp) . "\n";
|
||||
$read = fread($fp, 2096);
|
||||
$handle = popen('/path/to/spooge 2>&1', 'r');
|
||||
echo "'$handle'; " . gettype($handle) . "\n";
|
||||
$read = fread($handle, 2096);
|
||||
echo $read;
|
||||
pclose($fp);
|
||||
pclose($handle);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.rewind">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>rewind</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Sets the file position indicator for fp to the beginning of the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.tempnam">
|
||||
<refnamediv>
|
||||
|
@ -38,9 +38,9 @@
|
|||
<![CDATA[
|
||||
$tmpfname = tempnam ("/tmp", "FOO");
|
||||
|
||||
$fp = fopen($tmpfname, "w");
|
||||
fwrite($fp, "writing to tempfile");
|
||||
fclose($fp);
|
||||
$handle = fopen($tmpfname, "w");
|
||||
fwrite($handle, "writing to tempfile");
|
||||
fclose($handle);
|
||||
|
||||
// do here something
|
||||
|
||||
|
|
Loading…
Reference in a new issue