Bug #76460 [Opn]: Windows absolute symbolic links created without drive letter.
| From: | cmb@php.net | Date: | Tue, 12 Jun 2018 12:04:48 +0000 |
| Subject: | Bug #76460 [Opn]: Windows absolute symbolic links created without drive letter. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215648@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76460&edit=1
ID: 76460
Updated by: cmb@php.net
Reported by: php dot net at sameprecision dot org
Summary: Windows absolute symbolic links created without
drive letter.
Status: Open
Type: Bug
Package: *General Issues
Operating System: Windows Server 2016
PHP Version: 7.2.6
Block user comment: N
Private report: N
New Comment:
Related to bug #60841.
Previous Comments:
------------------------------------------------------------------------
[2018-06-12 02:29:03] php dot net at sameprecision dot org
Description:
------------
Absolute symbolic links for local drives created in a standard cmd shell without drive letter using
mklink are not followed in PHP. For instance, in cmd, "mklink /d c:\tmp\windows \windows"
creates a symbolic link (directory) to c:\windows.
In PHP, is_dir('c:/tmp/windows') returns false. is_link('c:/tmp/windows')
returns true. readlink('c:/tmp/windows') returns "c:/windows".
is_dir('/windows') returns true.
If the link is created with the drive letter, is_dir/is_file returns true.
This seems like an inconsistency given that is_file/is_dir recognize absolute paths to
files/directories that do not include the drive letter.
Test script:
---------------
Windows cmd shell without drive letter:
mkdir c:\tmp
mklink /d c:\tmp\windows \windows
PHP interactive CLI (php -a):
is_dir('c:/tmp/windows') == true //false
is_dir('/windows') == true //true
readlink('c:/tmp/windows') == 'c:\windows' //true
Windows cmd shell with drive letter:
mkdir c:\tmp
mklink /d c:\tmp\windows c:\windows
PHP interactive CLI (php -a):
is_dir('c:/tmp/windows') == true //true
is_dir('/windows') == true //true
readlink('c:/tmp/windows') == 'c:\windows' //true
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76460&edit=1