Bug #61441 [Nab]: readlink returns operating system specific directory separators in result
| From: | daveespionage at gmail dot com | Date: | Tue, 20 Mar 2012 21:07:51 +0000 |
| Subject: | Bug #61441 [Nab]: readlink returns operating system specific directory separators in result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168665@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
User updated by: daveespionage at gmail dot com
Reported by: daveespionage at gmail dot com
Summary: readlink returns operating system specific directory
separators in result
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:
@pajoye: Is this in the PHP documentation anywhere? I cannot find it in
http://php.net/manual/en/function.readlink.php
or the parent
http://www.php.net/manual/en/ref.filesystem.php
Should I file a missing documentation bug?
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2012-03-20 10:06:15] pajoye@php.net
Expected behavior. All files operations working with paths to clean or resolve
them returns the OS specific directory separator.
------------------------------------------------------------------------
[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