#35542 [NEW]: add ONLYFILES flag to glob() function
| From: | techtonik@php.net | Date: | Sun, 04 Dec 2005 08:03:42 +0000 |
| Subject: | #35542 [NEW]: add ONLYFILES flag to glob() function | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-89700@lists.php.net to get a copy of this message | ||
From: techtonik@php.net
Operating system: W2K
PHP version: 4.4.1
PHP Bug Type: Feature/Change Request
Bug description: add ONLYFILES flag to glob() function
Description:
------------
Currently glob() function returns an array containing the matched
files/directories or FALSE on error. There is GLOB_ONLYDIR flag to return
only directory entries which match the pattern, but no GLOB_ONLYFILES to
get the opposite.
Reproduce code:
---------------
Valid flags:
GLOB_MARK - Adds a slash to each item returned
GLOB_NOSORT - Return files as they appear in the directory (no sorting)
GLOB_NOCHECK - Return the search pattern if no files matching it were
found
GLOB_NOESCAPE - Backslashes do not quote metacharacters
GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', or 'c'
GLOB_ONLYDIR - Return only directory entries which match the pattern
Expected result:
----------------
$files = glob("dir/*", GLOB_ONLYFILES);
Actual result:
--------------
$files = array_diff(glob("dir/*"), glob("dir/*", GLOB_ONLYDIR));
--
Edit bug report at http://bugs.php.net/?id=35542&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35542&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35542&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35542&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35542&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35542&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35542&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35542&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35542&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35542&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35542&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35542&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35542&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35542&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35542&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35542&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35542&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35542&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35542&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35542&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35542&r=mysqlcfg