|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51804 SplFileInfo::getLinkTarget() Fails.
Submitted: 2010-05-13 03:36 UTC Modified: 2010-09-10 16:18 UTC
From: v-sumada at microsoft dot com Assigned: pajoye (profile)
Status: Closed Package: SPL related
PHP Version: 5.3SVN-2010-05-13 (SVN) OS: All Windows OS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: v-sumada at microsoft dot com
New email:
PHP Version: OS:


 [2010-05-13 03:36 UTC] v-sumada at microsoft dot com
SplFileInfo::getLinkTarget() fails .we have a filesymlink created  for a file (filesymbolic.txt)  and tried to read the target of the filesymlink created and it returns an error .This happens for Directory also.

When this Function used on accessing symlinks over remote share  it returns an error with 'Bad File Descriptor'.

Test script:
$filename = dirname(__FILE__)."\\filesymlink";
$filesyminfo =  new SplFileInfo($filename);

Expected result:
string(16) filesymbolic.txt

Actual result:
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to read link C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\symlinktodir, error: No such file or directory' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\getLinkTarget.php:5 Stack trace: #0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\getLinkTarget.php(5): SplFileInfo->getLinkTarget() #1 {main} thrown in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\getLinkTarget.php on line 5


add_php_sys_readlink (last revision 2010-09-06 15:14 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-07 01:56 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2010-08-07 01:56 UTC]
Pierre, I think you played with symlinks before, can you add the magic needed, here?
 [2010-09-06 17:14 UTC]
The following patch has been added/updated:

Patch Name: add_php_sys_readlink
Revision:   1283786074
 [2010-09-10 16:17 UTC]
Automatic comment from SVN on behalf of pajoye
Log: - Implement bug #51804, splFileInfo::getLinkTarget() on Windows
 [2010-09-10 16:18 UTC]
-Status: Assigned +Status: Closed -Type: Bug +Type: Feature/Change Request
 [2010-09-10 16:18 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jun 02 04:01:28 2020 UTC