Bug #13292 file_exists works with UNC names

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@84459 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kai Schröder 2002-06-02 19:03:06 +00:00
parent a256b90da7
commit 37caa3b5bb

View file

@ -1,14 +1,14 @@
<!-- D O N O T E D I T T H I S F I L E ! ! !
<!-- D O N O T E D I T T H I S F I L E ! ! !
it is still here for historical reasons only
it is still here for historical reasons only
(as translators may need to check old revision diffs)
if you want to change things documented in this file
you should now edit the files found under en/reference
instead -->
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.143 $ -->
<!-- $Revision: 1.144 $ -->
<reference id="ref.filesystem">
<title>Filesystem functions</title>
<titleabbrev>Filesystem</titleabbrev>
@ -19,7 +19,7 @@
and <link linkend="ref.exec">Program Execution</link> sections.
</simpara>
</partintro>
<refentry id="function.basename">
<refnamediv>
<refname>basename</refname>
@ -121,8 +121,8 @@ $file = basename ($path,".php"); // $file is set to "index"
<informalexample>
<programlisting role="php">
<![CDATA[
chmod ("/somedir/somefile", 755); // decimal; probably incorrect
chmod ("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect
chmod ("/somedir/somefile", 755); // decimal; probably incorrect
chmod ("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect
chmod ("/somedir/somefile", 0755); // octal; correct value of mode
]]>
</programlisting>
@ -356,7 +356,7 @@ $file = dirname ($path); // $file is set to "/etc"
<title><function>disk_free_space</function> example</title>
<programlisting role="php">
<![CDATA[
$df = disk_free_space("/"); // $df contains the number of bytes
$df = disk_free_space("/"); // $df contains the number of bytes
// available on "/"
]]>
</programlisting>
@ -435,7 +435,7 @@ $df = disk_total_space("/"); // $df contains the total number of
The file pointer must be valid, and must point to a file
successfully opened by <function>fopen</function> or
<function>fsockopen</function>.
</para>
</para>
</refsect1>
</refentry>
@ -474,8 +474,8 @@ $df = disk_total_space("/"); // $df contains the total number of
<methodparam><type>int</type><parameter>fp</parameter></methodparam>
</methodsynopsis>
<para>
This function forces a write of all buffered output to the
to the resource pointed to by the file handle
This function forces a write of all buffered output to the
to the resource pointed to by the file handle
<parameter>fp</parameter>. Returns &true; if successful, &false;
otherwise.
</para>
@ -507,7 +507,7 @@ $df = disk_total_space("/"); // $df contains the total number of
successfully opened by <function>fopen</function>,
<function>popen</function>, or <function>fsockopen</function>.
</para>
<para>
<para>
See also <function>fread</function>, <function>fopen</function>,
<function>popen</function>, <function>fsockopen</function>, and
<function>fgets</function>.
@ -593,7 +593,7 @@ fclose ($fp);
Returns a string of up to length - 1 bytes read from the file
pointed to by fp. Reading ends when length - 1 bytes have been
read, on a newline (which is included in the return value), or on
EOF (whichever comes first). If no length is specified, the length
EOF (whichever comes first). If no length is specified, the length
defaults to 1k, or 1024 bytes.
</para>
<para>
@ -614,7 +614,7 @@ fclose ($fp);
</simpara>
<para>
A simple example follows:
<example>
<example>
<title>Reading a file line by line</title>
<programlisting role="php">
<![CDATA[
@ -633,7 +633,7 @@ fclose ($fd);
The <parameter>length</parameter> parameter became optional in PHP 4.2.0
</simpara>
</note>
<para>
<para>
See also <function>fread</function>, <function>fopen</function>,
<function>popen</function>, <function>fgetc</function>,
<function>fsockopen</function>, and
@ -667,7 +667,7 @@ fclose ($fd);
<para>
<parameter>allowable_tags</parameter> was added in PHP 3.0.13,
PHP 4.0.0.
</para>
</para>
</note>
</para>
<para>
@ -692,7 +692,7 @@ fclose ($fd);
</methodsynopsis>
<para>
This function is currently only documented by the example below:
<example>
<example>
<title>Implementing a base64 encoding protocol</title>
<programlisting role="php">
<![CDATA[
@ -760,10 +760,10 @@ readfile("/tmp/outputfile");
</note>
</refsect1>
</refentry>
<refentry id="function.file-get-contents">
<refnamediv>
<refname>file_get_contents</refname>
<refname>file_get_contents</refname>
<refpurpose>Reads entire file into a string</refpurpose>
</refnamediv>
<refsect1>
@ -773,7 +773,7 @@ readfile("/tmp/outputfile");
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Identical to <function>readfile</function>, except that
<function>file_get_contents</function> returns the file in a string.
</para>
@ -786,10 +786,10 @@ readfile("/tmp/outputfile");
&tip.fopen-wrapper;
</refsect1>
</refentry>
<refentry id="function.file">
<refnamediv>
<refname>file</refname>
<refname>file</refname>
<refpurpose>Reads entire file into an array</refpurpose>
</refnamediv>
<refsect1>
@ -799,7 +799,7 @@ readfile("/tmp/outputfile");
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Identical to <function>readfile</function>, except that
<function>file</function> returns the file in an array. Each
element of the array corresponds to a line in the file, with the
@ -843,7 +843,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
</note>
&note.not-bin-safe;
&tip.fopen-wrapper;
<para>
<para>
See also <function>readfile</function>,
<function>fopen</function>, <function>fsockopen</function>, and
<function>popen</function>.
@ -876,6 +876,11 @@ $fcontents = implode ('', file ('http://www.example.com/'));
The results of this function are cached. See
<function>clearstatcache</function> for more details.
</simpara>
<simpara>
On windows use "//computername/share/filename" or
"\\\\computername\share\filename" to check files on
network shares.
</simpara>
</refsect1>
</refentry>
@ -891,7 +896,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>int</type><methodname>fileatime</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<simpara>
<simpara>
Returns the time the file was last accessed, or &false; in case of
an error. The time is returned as a Unix timestamp.
</simpara>
@ -940,9 +945,9 @@ $fcontents = implode ('', file ('http://www.example.com/'));
Note: In most Unix filesystems, a file is considered
changed when its inode data is changed; that is, when
the permissions, owner, group, or other metadata
from the inode is updated. See also
from the inode is updated. See also
<function>filemtime</function> (which is what you want to use
when you want to create "Last Modified" footers on web pages) and
when you want to create "Last Modified" footers on web pages) and
<function>fileatime</function>.
</para>
<para>Note also that in some Unix texts the ctime of a file is
@ -968,7 +973,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>int</type><methodname>filegroup</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Returns the group ID of the owner of the file, or &false; in case
of an error. The group ID is returned in numerical format, use
<function>posix_getgrgid</function> to resolve it to a group name.
@ -999,7 +1004,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>int</type><methodname>fileinode</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Returns the inode number of the file, or &false; in case of an
error.</para>
<para>
@ -1062,7 +1067,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>int</type><methodname>fileowner</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Returns the user ID of the owner of the file, or &false; in case of
an error. The user ID is returned in numerical format, use
<function>posix_getpwuid</function> to resolve it to a username.
@ -1091,7 +1096,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>int</type><methodname>fileperms</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Returns the permissions on the file, or &false; in case of an error.
</para>
<simpara>
@ -1117,7 +1122,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>int</type><methodname>filesize</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Returns the size of the file in bytes, or &false; in case of an error.
</para>
<para>
@ -1143,7 +1148,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<type>string</type><methodname>filetype</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Returns the type of the file. Possible values are fifo, char,
dir, block, link, file, and unknown.
</para>
@ -1282,7 +1287,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
</note>
</refsect1>
</refentry>
<refentry id="function.fopen">
<refnamediv>
<refname>fopen</refname>
@ -1400,7 +1405,7 @@ $fcontents = implode ('', file ('http://www.example.com/'));
<para>
The <parameter>mode</parameter> may contain the letter
'b'. This is useful only on systems which differentiate between
binary and text files (i.e. Windows. It's useless on Unix).
binary and text files (i.e. Windows. It's useless on Unix).
If not needed, this will be ignored.
</para>
</note>
@ -1432,7 +1437,7 @@ $fp = fopen ("ftp://user:password@example.com/", "w");
On the Windows platform, be careful to escape any backslashes
used in the path to the file, or use forward slashes.
<informalexample>
<programlisting role="php">
<programlisting role="php">
<![CDATA[
$fp = fopen ("c:\\data\\info.txt", "r");
]]>
@ -1450,7 +1455,7 @@ $fp = fopen ("c:\\data\\info.txt", "r");
<refentry id="function.fpassthru">
<refnamediv>
<refname>fpassthru</refname>
<refname>fpassthru</refname>
<refpurpose>Output all remaining data on a file pointer</refpurpose>
</refnamediv>
<refsect1>
@ -1537,7 +1542,7 @@ $fp = fopen ("c:\\data\\info.txt", "r");
referenced by <parameter>fp</parameter>. Reading stops when
<parameter>length</parameter> bytes have been read or EOF is
reached, whichever comes first.
</simpara>
</simpara>
<para>
<informalexample>
<programlisting role="php">
@ -1553,7 +1558,7 @@ fclose ($fd);
</para>
<note>
<para>
On systems which differentiate between binary and text files
On systems which differentiate between binary and text files
(i.e. Windows) the file must be opened with 'b' included in
<function>fopen</function> mode parameter.
</para>
@ -1659,8 +1664,8 @@ luigi florist it
<simplelist>
<member>SEEK_SET - Set position equal to <parameter>offset</parameter> bytes.</member>
<member>SEEK_CUR - Set position to current location plus <parameter>offset</parameter>.</member>
<member>SEEK_END - Set position to end-of-file plus <parameter>offset</parameter>.
(To move to a position before the end-of-file, you need to pass a negative
<member>SEEK_END - Set position to end-of-file plus <parameter>offset</parameter>.
(To move to a position before the end-of-file, you need to pass a negative
value in <parameter>offset</parameter>.)</member>
</simplelist>
</para>
@ -1755,7 +1760,7 @@ luigi florist it
successfully opened by <function>fopen</function> or
<function>popen</function>.
</para>
<para>
<para>
See also <function>fopen</function>, <function>popen</function>,
<function>fseek</function>, and <function>rewind</function>.
</para>
@ -1775,8 +1780,8 @@ luigi florist it
<methodparam><type>int</type><parameter>size</parameter></methodparam>
</methodsynopsis>
<para>
Takes the filepointer, <parameter>fp</parameter>, and truncates the file to
length, <parameter>size</parameter>. This function returns &true; on
Takes the filepointer, <parameter>fp</parameter>, and truncates the file to
length, <parameter>size</parameter>. This function returns &true; on
success and &false; on failure.
</para>
</refsect1>
@ -1817,7 +1822,7 @@ luigi florist it
</simpara>
<note>
<para>
On systems which differentiate between binary and text files
On systems which differentiate between binary and text files
(i.e. Windows) the file must be opened with 'b' included in
<function>fopen</function> mode parameter.
</para>
@ -2265,7 +2270,7 @@ mkdir ("/path/to/my/dir", 0700);
If <parameter>filename</parameter> is not a valid upload file,
then no action will occur, and
<function>move_uploaded_file</function> will return
&false;.
&false;.
</para>
<para>
If <parameter>filename</parameter> is a valid upload file, but
@ -2474,14 +2479,14 @@ html
<type>int</type><methodname>pclose</methodname>
<methodparam><type>int</type><parameter>fp</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Closes a file pointer to a pipe opened by
<function>popen</function>.
</para>
<para>
</para>
<para>
The file pointer must be valid, and must have been returned by a
successful call to <function>popen</function>.
</para>
</para>
<para>
Returns the termination status of the process that was
run.
@ -2505,11 +2510,11 @@ html
<methodparam><type>string</type><parameter>command</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Opens a pipe to a process executed by forking the command given
by command.
</para>
<para>
<para>
Returns a file pointer identical to that returned by
<function>fopen</function>, except that it is unidirectional (may
only be used for reading or writing) and must be closed with
@ -2518,7 +2523,7 @@ html
<function>fputs</function>.
</para>
<para>
If an error occurs, returns &false;.
If an error occurs, returns &false;.
</para>
<para>
<informalexample>
@ -2650,11 +2655,11 @@ pclose($fp);
<methodparam><type>string</type><parameter>oldname</parameter></methodparam>
<methodparam><type>string</type><parameter>newname</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Attempts to rename <parameter>oldname</parameter> to
<parameter>newname</parameter>.
</para>
<para>
</para>
<para>
&return.success;
</para>
</refsect1>
@ -2671,11 +2676,11 @@ pclose($fp);
<type>int</type><methodname>rewind</methodname>
<methodparam><type>int</type><parameter>fp</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Sets the file position indicator for fp to the beginning of the
file stream.
</para>
<para>
</para>
<para>
If an error occurs, returns 0.
</para>
<para>
@ -2707,11 +2712,11 @@ pclose($fp);
<type>bool</type><methodname>rmdir</methodname>
<methodparam><type>string</type><parameter>dirname</parameter></methodparam>
</methodsynopsis>
<para>
<para>
Attempts to remove the directory named by <parameter>dirname</parameter>.
The directory must be empty, and the relevant permissions must permit this.
&return.success;
</para>
</para>
<para>
See also <function>mkdir</function> and <function>unlink</function>.
</para>
@ -2895,7 +2900,7 @@ $real_path = realpath ("../../index.php");
Creates a file with a unique filename in the specified directory.
If the directory does not exist, <function>tempnam</function> may
generate a file in the system's temporary directory, and return
the name of that.
the name of that.
</para>
<para>
Prior to PHP 4.0.6, the behaviour of the
@ -3013,7 +3018,7 @@ fclose($temp); // this removes the file
<programlisting role="php">
<![CDATA[
if (touch ($FileName)) {
print "$FileName modification time has been
print "$FileName modification time has been
changed to todays date and time";
} else {
print "Sorry Could Not change modification time of $FileName";