Clarify x and x+ modes. They generate E_WARNING and false when file exists, and

attempt to create the file if the file does not yet exist.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@133540 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-06-28 20:59:12 +00:00
parent 2f813e99ae
commit 5434e2e2f0

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.17 $ -->
<!-- $Revision: 1.18 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.fopen">
<refnamediv>
@ -120,26 +120,26 @@
<entry><literal>'x'</literal></entry>
<entry>
Create and open for writing only; place the file pointer at the
beginning of the file.
If the file already exists, the <function>fopen</function>
call will fail.
This is equivalent to specifying <literal>O_EXCL|O_CREAT</literal> flags
for the underlying <literal>open(2)</literal> system call.
This option is supported in PHP 4.3.2 and later, and only for local
files.
beginning of the file. If the file already exists, the
<function>fopen</function> call will fail by returning &false; and
generating an error of level <constant>E_WARNING</constant>. If
the file does not exist, attempt to create it. This is equivalent
to specifying <literal>O_EXCL|O_CREAT</literal> flags for the
underlying <literal>open(2)</literal> system call. This option is
supported in PHP 4.3.2 and later, and only works for local files.
</entry>
</row>
<row>
<entry><literal>'x+'</literal></entry>
<entry>
Create and open for reading and writing; place the file pointer at the
beginning of the file.
If the file already exists, the <function>fopen</function>
call will fail.
This is equivalent to specifying <literal>O_EXCL|O_CREAT</literal> flags
for the underlying <literal>open(2)</literal> system call.
This option is supported in PHP 4.3.2 and later, and only for local
files.
Create and open for reading and writing; place the file pointer at
the beginning of the file. If the file already exists, the
<function>fopen</function> call will fail by returning &false; and
generating an error of level <constant>E_WARNING</constant>. If
the file does not exist, attempt to create it. This is equivalent
to specifying <literal>O_EXCL|O_CREAT</literal> flags for the
underlying <literal>open(2)</literal> system call. This option is
supported in PHP 4.3.2 and later, and only works for local files.
</entry>
</row>
</tbody>