Req #35542 [Opn->Bgs]: add ONLYFILES flag to glob() function

From: Date: Wed, 22 Dec 2010 11:54:46 +0000
Subject: Req #35542 [Opn->Bgs]: add ONLYFILES flag to glob() function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157215@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=35542&edit=1 ID: 35542 Updated by: johannes@php.net Reported by: techtonik@php.net Summary: add ONLYFILES flag to glob() function -Status: Open +Status: Bogus Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: W2K PHP Version: 4.4.1 Block user comment: N Private report: N New Comment: glob is wrapper around the POSIX glob() function. the fag has to be added to POSIX first therefore. Previous Comments: ------------------------------------------------------------------------ [2005-12-04 09:03:40] techtonik@php.net 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 this bug report at http://bugs.php.net/bug.php?id=35542&edit=1

« previous php.bugs (#157215) next »