#43953 [Asn->Csd]: glob:// appends filenames to the pattern
| From: | bjori@php.net | Date: | Fri, 01 Feb 2008 10:47:54 +0000 |
| Subject: | #43953 [Asn->Csd]: glob:// appends filenames to the pattern | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121860@lists.php.net to get a copy of this message | ||
ID: 43953
Updated by: bjori@php.net
Reported By: hannes dot magnusson at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 5.3CVS-2008-01-28 (CVS)
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2008-01-28 14:07:09] hannes dot magnusson at gmail dot com
Description:
------------
Looks like glob:// appends the filenames, rather than replacing the
pattern with the filename..
Reproduce code:
---------------
<?php
$it = new DirectoryIterator("glob://ext/spl/examples/*.php");
foreach($it as $f) {
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize()/1024);
}
Expected result:
----------------
class_tree.php: 1.8K
tree.php: 1.0K
findregex.php: 0.6K
findfile.php: 0.7K
dba_dump.php: 0.9K
nocvsdir.php: 1.1K
phar_from_dir.php: 1.0K
ini_groups.php: 0.9K
directorytree.php: 0.9K
dba_array.php: 1.1K
Actual result:
--------------
PHP Fatal error: Uncaught exception 'RuntimeException' with message
'SplFileInfo::getSize(): stat failed for
glob://ext/spl/examples/*.php/class_tree.php' in
/home/bjori/php/5.3/-:6
Stack trace:
#0 /home/bjori/php/5.3/-(6): SplFileInfo->getSize()
#1 {main}
thrown in /home/bjori/php/5.3/- on line 6
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43953&edit=1