Bug #61441 [Opn->Nab]: readlink returns operating system specific directory separators in result
| From: | pajoye@php.net | Date: | Tue, 20 Mar 2012 10:06:16 +0000 |
| Subject: | Bug #61441 [Opn->Nab]: readlink returns operating system specific directory separators in result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168642@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61441&edit=1
ID: 61441
Updated by: pajoye@php.net
Reported by: daveespionage at gmail dot com
Summary: readlink returns operating system specific directory
separators in result
-Status: Open
+Status: Not a bug
Type: Bug
Package: Filesystem function related
Operating System: Windows 7 64 bit
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
Expected behavior. All files operations working with paths to clean or resolve
them returns the OS specific directory separator.
Previous Comments:
------------------------------------------------------------------------
[2012-03-19 19:02:35] daveespionage at gmail dot com
I should have clarified in the description, $_SERVER['DOCUMENT_ROOT'] in this case
is pointed to a directory symlink created with 'mklink /D', that has the alias
'c:\sites\project' and resolves to 'c:\work\Project\wwwroot'
------------------------------------------------------------------------
[2012-03-19 18:57:57] daveespionage at gmail dot com
Description:
------------
readlink when called on a directory symlink in Windows 7 returns directory
separators of '\', whereas seemingly most other filesystem functions return
directory separators of '/' regardless of host operating system.
Test script:
---------------
<?php
echo 'Docroot: ' . $_SERVER['DOCUMENT_ROOT'] . '<br />';
echo 'Readlink: ' . readlink($_SERVER['DOCUMENT_ROOT']) . '<br
/>';
?>
Expected result:
----------------
Docroot: C:/sites/project
Readlink: C:/work/Project/wwwroot
Actual result:
--------------
Docroot: C:/sites/project
Readlink: C:\work\Project\wwwroot
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61441&edit=1