|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-07-02 10:38 UTC] pedro dot laguna at pentura dot com
Description:
------------
glob:// wrapper doesn't support current queries like glob://*
Test script:
---------------
<?php
$it = new DirectoryIterator("glob://*");
foreach($it as $f) {
printf("%s: %.1FK<br />", $f->getFilename(), $f->getSize()/1024);
}
?>
Expected result:
----------------
A list of files with their file size associated as show in the glob example page:
http://php.net/manual/en/wrappers.glob.php
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
class_tree.php: 1.8K
Actual result:
--------------
Fatal error: Uncaught exception 'RuntimeException' with message
'SplFileInfo::getSize(): stat failed for /CREDITS' in /home/pedro/Desktop/php-
5.3.2/sapi/cli/test.php:4
Stack trace:
#0 /home/pedro/Desktop/php-5.3.2/sapi/cli/test.php(4): SplFileInfo->getSize()
#1 {main}
thrown in /home/pedro/Desktop/php-5.3.2/sapi/cli/test.php on line 4
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 07:00:02 2025 UTC |
Reproducible on PHP 5.5.20. [root@brian ~]# php bug.php bin: 20.0K<br />PHP Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileInfo::getSize(): stat failed for /bug.php' in /root/bug.php:4 Stack trace: #0 /root/bug.php(4): SplFileInfo->getSize() #1 {main} thrown in /root/bug.php on line 4 [root@brian ~]# php -v PHP 5.5.20 (cli) (built: Dec 17 2014 14:58:05) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies