#48535 [Opn->Fbk]: file_exists returns false if the file path is a symlink
| From: | pajoye@php.net | Date: | Fri, 12 Jun 2009 09:29:18 +0000 |
| Subject: | #48535 [Opn->Fbk]: file_exists returns false if the file path is a symlink | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-138235@lists.php.net to get a copy of this message | ||
ID: 48535
Updated by: pajoye@php.net
Reported By: tobias dot burger at rolmail dot net
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Windows Server 2008
PHP Version: 5.3.0RC3
Assigned To: pajoye
New Comment:
I use 2008 as well and it works fine. Can you add perms for your user
specifically and test again?
Previous Comments:
------------------------------------------------------------------------
[2009-06-12 09:25:55] tobias dot burger at rolmail dot net
User group EVERYONE has full permissions.
Other operations are working on that file:
e.g. include_once, file_get_contents
------------------------------------------------------------------------
[2009-06-12 09:21:56] pajoye@php.net
c:\php53rc3tsvc9x86> php -r "var_dump(file_exists('news.txt'));"
bool(true)
c:\php53rc3tsvc9x86> php -r
"var_dump(file_exists(realpath('news.txt')));"
bool(true)
c:\php53rc3tsvc9x86> php -r
"var_dump(file_exists(realpath('news123.txt')));"
bool(false)
same with VC6 builds.
I suspect David is right, the console may be run under a user not
having the permissions to access c:\inetpub (5.3 has ACL supports now
and actually returns the right info).
------------------------------------------------------------------------
[2009-06-12 09:17:41] dsp@php.net
Please check if you have the correct permissions.
------------------------------------------------------------------------
[2009-06-12 08:00:29] tobias dot burger at rolmail dot net
Correction: file_exists does ALWAYS return false, even for normal file
pathes
------------------------------------------------------------------------
[2009-06-12 07:32:37] tobias dot burger at rolmail dot net
Description:
------------
file_exists returns false if the file path is a symlink
Reproduce code:
---------------
# d:\myfolder\test.php
> mklink /D c:\inetpub\wwwroot\myfolder d:\myfolder
file_exists('c:\inetpub\wwwroot\myfolder\test.php')
Expected result:
----------------
true
Actual result:
--------------
false
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48535&edit=1