PHP 4.0 Bug #8519 Updated: closedir() does not close directory handle until script terminates
| From: | sniper@php.net | Date: | Wed, 03 Jan 2001 01:01:24 +0000 |
| Subject: | PHP 4.0 Bug #8519 Updated: closedir() does not close directory handle until script terminates | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42764@lists.php.net to get a copy of this message | ||
ID: 8519
Updated by: sniper
Reported By: kat@unleashed.org
Old-Status: Open
Status: Closed
Bug Type: Directory function related
Assigned To:
Comments:
This is fixed in PHP 4.0.4.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-01-02 13:28:43] kat@unleashed.org
The below script will generate a "permission denied" error when trying to rmdir the
specified directory. sleep() does not do any good (in helping me delete the dir), nor does putting
the reading of the directory into a function. After I moved the rmdir into a separate script it did
not generate an error. It makes no difference whether it's forward or backward slashes in the
path.
This happens only after using the opendir/readdir/closedir sequence. I have not tested further to
see if readdir may be the issue.
This is a stock 4.03pl1 php, running as an apache module.
My Test script:
-------------------------
<?php
$dirName = "c:/temp/foo.bar";
function checkDir()
{
global $dirName;
$dirHandle = opendir($dirName);
while($fileName = readdir($dirHandle))
{
print $fileName."n";
}
closedir($dirHandle);
}
print "Making directoryn";
mkdir($dirName, 0777);
checkDir();
print "Removing directoryn";
rmdir($dirName);
?>
--------------------------------------------
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8519