Edit report at http://bugs.php.net/bug.php?id=35542&edit=1

 ID:                 35542
 Updated by:         [email protected]
 Reported by:        [email protected]
 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] [email protected]

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

Reply via email to