From 37caa3b5bb0d16ff7343e7ecbcbd37b94a5d4cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Schr=C3=B6der?= Date: Sun, 2 Jun 2002 19:03:06 +0000 Subject: [PATCH] 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 --- functions/filesystem.xml | 131 ++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 63 deletions(-) diff --git a/functions/filesystem.xml b/functions/filesystem.xml index e85e246944..51e51ad51c 100644 --- a/functions/filesystem.xml +++ b/functions/filesystem.xml @@ -1,14 +1,14 @@ - - + - + Filesystem functions Filesystem @@ -19,7 +19,7 @@ and Program Execution sections. - + basename @@ -121,8 +121,8 @@ $file = basename ($path,".php"); // $file is set to "index" @@ -356,7 +356,7 @@ $file = dirname ($path); // $file is set to "/etc" <function>disk_free_space</function> example @@ -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 fopen or fsockopen. - + @@ -474,8 +474,8 @@ $df = disk_total_space("/"); // $df contains the total number of intfp - 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 fp. Returns &true; if successful, &false; otherwise. @@ -507,7 +507,7 @@ $df = disk_total_space("/"); // $df contains the total number of successfully opened by fopen, popen, or fsockopen. - + See also fread, fopen, popen, fsockopen, and fgets. @@ -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. @@ -614,7 +614,7 @@ fclose ($fp); A simple example follows: - + Reading a file line by line length parameter became optional in PHP 4.2.0 - + See also fread, fopen, popen, fgetc, fsockopen, and @@ -667,7 +667,7 @@ fclose ($fd); allowable_tags was added in PHP 3.0.13, PHP 4.0.0. - + @@ -692,7 +692,7 @@ fclose ($fd); This function is currently only documented by the example below: - + Implementing a base64 encoding protocol - + - file_get_contents + file_get_contents Reads entire file into a string @@ -773,7 +773,7 @@ readfile("/tmp/outputfile"); stringfilename intuse_include_path - + Identical to readfile, except that file_get_contents returns the file in a string. @@ -786,10 +786,10 @@ readfile("/tmp/outputfile"); &tip.fopen-wrapper; - + - file + file Reads entire file into an array @@ -799,7 +799,7 @@ readfile("/tmp/outputfile"); stringfilename intuse_include_path - + Identical to readfile, except that file 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/')); ¬e.not-bin-safe; &tip.fopen-wrapper; - + See also readfile, fopen, fsockopen, and popen. @@ -876,6 +876,11 @@ $fcontents = implode ('', file ('http://www.example.com/')); The results of this function are cached. See clearstatcache for more details. + + On windows use "//computername/share/filename" or + "\\\\computername\share\filename" to check files on + network shares. + @@ -891,7 +896,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); intfileatime stringfilename - + Returns the time the file was last accessed, or &false; in case of an error. The time is returned as a Unix timestamp. @@ -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 filemtime (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 fileatime. Note also that in some Unix texts the ctime of a file is @@ -968,7 +973,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); intfilegroup stringfilename - + 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 posix_getgrgid to resolve it to a group name. @@ -999,7 +1004,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); intfileinode stringfilename - + Returns the inode number of the file, or &false; in case of an error. @@ -1062,7 +1067,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); intfileowner stringfilename - + 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 posix_getpwuid to resolve it to a username. @@ -1091,7 +1096,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); intfileperms stringfilename - + Returns the permissions on the file, or &false; in case of an error. @@ -1117,7 +1122,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); intfilesize stringfilename - + Returns the size of the file in bytes, or &false; in case of an error. @@ -1143,7 +1148,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); stringfiletype stringfilename - + Returns the type of the file. Possible values are fifo, char, dir, block, link, file, and unknown. @@ -1282,7 +1287,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); - + fopen @@ -1400,7 +1405,7 @@ $fcontents = implode ('', file ('http://www.example.com/')); The mode 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. @@ -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. - + @@ -1450,7 +1455,7 @@ $fp = fopen ("c:\\data\\info.txt", "r"); - fpassthru + fpassthru Output all remaining data on a file pointer @@ -1537,7 +1542,7 @@ $fp = fopen ("c:\\data\\info.txt", "r"); referenced by fp. Reading stops when length bytes have been read or EOF is reached, whichever comes first. - + @@ -1553,7 +1558,7 @@ fclose ($fd); - 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 fopen mode parameter. @@ -1659,8 +1664,8 @@ luigi florist it SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. - SEEK_END - Set position to end-of-file plus offset. - (To move to a position before the end-of-file, you need to pass a negative + SEEK_END - Set position to end-of-file plus offset. + (To move to a position before the end-of-file, you need to pass a negative value in offset.) @@ -1755,7 +1760,7 @@ luigi florist it successfully opened by fopen or popen. - + See also fopen, popen, fseek, and rewind. @@ -1775,8 +1780,8 @@ luigi florist it intsize - Takes the filepointer, fp, and truncates the file to - length, size. This function returns &true; on + Takes the filepointer, fp, and truncates the file to + length, size. This function returns &true; on success and &false; on failure. @@ -1817,7 +1822,7 @@ luigi florist it - 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 fopen mode parameter. @@ -2265,7 +2270,7 @@ mkdir ("/path/to/my/dir", 0700); If filename is not a valid upload file, then no action will occur, and move_uploaded_file will return - &false;. + &false;. If filename is a valid upload file, but @@ -2474,14 +2479,14 @@ html intpclose intfp - + Closes a file pointer to a pipe opened by popen. - - + + The file pointer must be valid, and must have been returned by a successful call to popen. - + Returns the termination status of the process that was run. @@ -2505,11 +2510,11 @@ html stringcommand stringmode - + Opens a pipe to a process executed by forking the command given by command. - + Returns a file pointer identical to that returned by fopen, except that it is unidirectional (may only be used for reading or writing) and must be closed with @@ -2518,7 +2523,7 @@ html fputs. - If an error occurs, returns &false;. + If an error occurs, returns &false;. @@ -2650,11 +2655,11 @@ pclose($fp); stringoldname stringnewname - + Attempts to rename oldname to newname. - - + + &return.success; @@ -2671,11 +2676,11 @@ pclose($fp); intrewind intfp - + Sets the file position indicator for fp to the beginning of the file stream. - - + + If an error occurs, returns 0. @@ -2707,11 +2712,11 @@ pclose($fp); boolrmdir stringdirname - + Attempts to remove the directory named by dirname. The directory must be empty, and the relevant permissions must permit this. &return.success; - + See also mkdir and unlink. @@ -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, tempnam may generate a file in the system's temporary directory, and return - the name of that. + the name of that. Prior to PHP 4.0.6, the behaviour of the @@ -3013,7 +3018,7 @@ fclose($temp); // this removes the file