#30564 [Com]: existing files not seen (not existant)

[email protected] ("vyacheslav dot petrov at yahoo dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               30564
 Comment by:       vyacheslav dot petrov at yahoo dot com
 Reported By:      cherub at dagservice dot nl
 Status:           No Feedback
 Bug Type:         Filesystem function related
 Operating System: Windows XP SP2
 PHP Version:      5.0.1
 New Comment:

Hello,

I'm using "ApacheFriends XAMPP (basic package) version 1.6" (includes
php 5.2.6) on a Windows XP SP2 computer and experience the same problem
when installing "MediaWiki v 1.12.0" script.

It requires "diff3.exe" file, so I put it to "c:\Program Files\diff\"
folder and added the folder to "Path" environment variable. When I run
the MediaWiki installation script, it states "Diff3 not found". However,
if I put "diff3.exe" to "c:\Windows\", MediaWiki locates it and states
"Diff3 found at ...".

I've examined the code and it appears as file_exists() function returns
false if the path to the file contains spaces even if the path is
correct.


Previous Comments:
------------------------------------------------------------------------

[2004-11-13 01:00:02] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2004-11-04 13:49:09] [email protected]

Please provide a complete example script, so we can just run it and see
the problem.

------------------------------------------------------------------------

[2004-10-26 16:40:48] cherub at dagservice dot nl

Description:
------------
I used the script below to generate a filename, and check if it already
exists useing file_exists (block 1). It generates the following output:
"File 'C:\Program Files\Apache
Group\Apache2\htdocs\aanleverwizard/temppics/e88d28551c277889a0b34b4b2135d348/pic0.png'
does not exist!". However, when I copy/paste this to the windows run
dialog, it actually is executed, so the file does exist!

I also tried replacing the file_exists function with a replacement
function (block 2), but that also doesn't work...

Reproduce code:
---------------
//BLOCK 1: REPRODUCE FILE_EXISTS BUG
$Teller = 0;
$TestFile = getcwd(). '/temppics/'. session_id(). '/pic'. $Teller.
'.png';
if (file_exists($TestFile)){
    echo('File \''. $TestFile. '\' exists!<BR>');
} else {
    echo('File \''. $TestFile. '\' does not exist!<BR>');
}
// BLOCK2: ALTERNATIVE TO FILE_EXISTS FUNCTION
	if (!function_exists('file_does_exist')){
		function file_does_exist($FileName){
			if (glob($FileName)){
				return true;
			} else return false;
		}
	}

Expected result:
----------------
I expect file_exists to return true, but it does not. I did verify that
the file does actually exist.

Actual result:
--------------
// see description.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30564&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.