#35998 [Opn->Asn]: getPathname() method always returns unix style filenames.
| From: | tony2001@php.net | Date: | Fri, 13 Jan 2006 16:48:38 +0000 |
| Subject: | #35998 [Opn->Asn]: getPathname() method always returns unix style filenames. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91855@lists.php.net to get a copy of this message | ||
ID: 35998
Updated by: tony2001@php.net
Reported By: rquadling at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: SPL related
Operating System: Windows XP SP2
PHP Version: 5.1.2
-Assigned To:
+Assigned To: helly
New Comment:
Assigned to the maintainer.
Previous Comments:
------------------------------------------------------------------------
[2006-01-13 17:07:14] rquadling at gmail dot com
Description:
------------
The pathnames returned by DirectoryIterator::getPathname() are always
with '/'. Which is no good for windows.
In /* $Id: spl_directory.c,v 1.63 2006/01/01 13:09:54 sniper Exp $ */
Line 165 the culprit is the "%s/%s".
Ideally the filename should come back appropriate to the DEFAULT_SLASH
constant defined in tsrm_virtual_cwd.h
This constant is controlled by compiler directive TSRM_WIN32.
This is used in realpath which the PHP code below demonstrates.
Reproduce code:
---------------
<?php
foreach(new DirectoryIterator('C:\\') as $o_FILE)
{
echo $o_FILE->getPathname() . "\t" . realpath($o_FILE->getPathname())
. "\n";
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35998&edit=1