Ask a Question related to PHP Bugs, Design and Development.
-
francois at tekwire dot net #1
#38022 [Com]: glob() problems
ID: 38022
Comment by: francois at tekwire dot net
Reported By: flconseil at yahoo dot fr
Status: Open
Bug Type: Feature/Change Request
Operating System: All
PHP Version: 5.1.4
New Comment:
An internal glob() implementation should also provide a flag to exclude
hidden files (Unix: starting with a dot, Windows: hidden).
Previous Comments:
------------------------------------------------------------------------
[2006-07-06 15:10:29] flconseil at yahoo dot fr
Description:
------------
Today, glob() calls the libc glob() function, with the following
problems:
- Possible inconsistencies between implementations (POSIX compliance)
- fnmatch not available outside of Unix : an internal glob()
implementation would bring an internal fnmatch() implementation, which
would allow fnmatch() on every platform.
- Important: on most (every ?) Unix systems, glob() is using stat()
instead of lstat(). Thus, broken links are ignored. Inconsistant with a
naive 'ls' which lists everything in the directory.
- The current glob() implementation in PHP (ext/standard/dir.c) assumes
that all returned matches are in the same directory, which is wrong. So,
the 'safe mode' and 'open_basedir' checks are wrong.
- glob() does not support streams, although most other directory
functions support them. It cannot be done without implementing glob()
internally.
- Apart from glob(), the chdir() and getcwd() functions should also
support stream-wrapped directories. It would be easy to implement but
it must be synchronized with the support of stream wrapped paths in the
include path.
Reproduce code:
---------------
None
Expected result:
----------------
None
Actual result:
--------------
None
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=38022&edit=1[/url]
francois at tekwire dot net Guest
-
File::Glob bug ?
The following script: use File::Glob ':glob'; my @test = ( '{random string}', '\\{random string\\}' ); for (@test) { -
use of glob
I'm somewhat new to PHP, so I'm hoping there is someone that can help me out with this one. I was recently working on a solution that would... -
variable file glob into grep without glob()
Hope I don't get shot for posting again, but I really need help with this ... I want to process lots (thousands) of files. I want to take a file... -
some terrible problems with glob
Hello guys,some things in my code are happening,which I don't understand.I am trying to open different directories and to load a bunch of files.But... -
GLOB/FH/String
Hi, I have an FileHandle $fh; When I do "print $fh" the FileHandle is treated as a String and it prints the filename. I need to have a scalar...



Reply With Quote

