php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43953 glob:// appends filenames to the pattern
Submitted: 2008-01-28 14:07 UTC Modified: 2008-02-01 10:47 UTC
From: hannes dot magnusson at gmail dot com Assigned: helly (profile)
Status: Closed Package: Filesystem function related
PHP Version: 5.3CVS-2008-01-28 (CVS) OS: Linux
Private report: No CVE-ID: None
 [2008-01-28 14:07 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-01 10:47 UTC] bjori@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 06:01:34 2024 UTC