Bug #53062 [Opn->Wfx]: emit error on "readdir" when the directory does no more exists
| From: | iliaa@php.net | Date: | Mon, 29 Nov 2010 14:32:21 +0000 |
| Subject: | Bug #53062 [Opn->Wfx]: emit error on "readdir" when the directory does no more exists | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156542@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53062&edit=1
ID: 53062
Updated by: iliaa@php.net
Reported by: giorgio dot liscio at email dot it
Summary: emit error on "readdir" when the directory does no
more exists
-Status: Open
+Status: Wont fix
Type: Bug
Package: *Directory/Filesystem functions
Operating System: any?
PHP Version: 5.3.3
Block user comment: N
Private report: N
New Comment:
The data handle still exists in memory even those directory was removed.
It would
be too performance inhibitive to check if directory still exists on
every call to
readdir().
Previous Comments:
------------------------------------------------------------------------
[2010-10-14 06:57:11] giorgio dot liscio at email dot it
Description:
------------
hi
user 1: opendir("mydir");
at the same time:
user 2: rmdir("mydir");
the dir is removed, but user1 tries to read it:
user 1: readdir(); // no error here
or you can just simply test this:
$handle = opendir('mydir');
rmdir("mydir");
// no error here
// the dir is empty so "echo $file" is not executed, but the dir does
not exists, not empty
while (false !== ($file = readdir($handle))) echo $file;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53062&edit=1