Bug #42778 [Com]: realpath() adds trailing slash
| From: | php dot net at digilog dot de | Date: | Fri, 11 Jun 2010 07:31:43 +0000 |
| Subject: | Bug #42778 [Com]: realpath() adds trailing slash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151313@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=42778&edit=1
ID: 42778
Comment by: php dot net at digilog dot de
Reported by: k dot bizuns at inbox dot lv
Summary: realpath() adds trailing slash
Status: Bogus
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows
PHP Version: 5.2.4
New Comment:
Does it really make sense that this function behaves so inconsistently
about its
trailing slashes between Linux and Win?:
LINUX (tested with PHP 5.2.11):
---
realpath('.')
: string = "/myhttpdfolder"
realpath('./')
: string = "/myhttpdfolder"
realpath('fileadmin')
: string = "/myhttpdfolder/fileadmin"
realpath('fileadmin/')
: string = "/myhttpdfolder/fileadmin"
WINDOWS (tested with PHP 5.2.5):
---
realpath('.')
: string = "C:\\myhttpdfolder"
realpath('./')
: string = "C:\\myhttpdfolder\\"
realpath('fileadmin')
: string = "C:\\myhttpdfolder\\fileadmin"
realpath('fileadmin/')
: string = "C:\\myhttpdfolder\\fileadmin\\"
Previous Comments:
------------------------------------------------------------------------
[2007-10-02 09:33:23] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2007-09-27 13:49:50] k dot bizuns at inbox dot lv
Description:
------------
<?php
echo realpath( './' ) ;
?>
This code in PHP 5.2.4 gives an output with trailing slash (example:
C:\www\)
PHP 5.2.3 not (example: C:\www).
Who is right? Tested on WinXP.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=42778&edit=1