|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20123 rewinddir() makes closedir() not working
Submitted: 2002-10-27 12:42 UTC Modified: 2002-10-27 12:58 UTC
From: tomasr at centrum dot cz Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.2.0 OS: Windows 2000 (NTFS)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: tomasr at centrum dot cz
New email:
PHP Version: OS:


 [2002-10-27 12:42 UTC] tomasr at centrum dot cz
When using rewinddir(), the next closedir() function doesn't release the directory handle, so the directory is locked forever (I had to restart web server to be able to delete this directory). I'm using Windows 2000 on NTFS, PHP 4.2.1 binaries and Apache 1.3.24. Below is a sample code which generates this error: 

"rmdir() failed (Permission denied) in rewinddir.php on line 14"

Tomas Rubringer

<title>strange rewinddir()</title>


$dir = "./test";
mkdir($dir, 0777);
$handle = opendir($dir);




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-27 12:46 UTC]
Please try using this CVS snapshot:
For Windows:
 [2002-10-27 12:54 UTC] tomasr at centrum dot cz
Yes, thanks, I already tried But, for the present this snapshot doesn't work with my Apache. So, I replaced the rewinddir() by the closedir() + opendir() and everything works fine.
 [2002-10-27 12:55 UTC]
closing then
 [2002-10-27 12:57 UTC] tomasr at centrum dot cz
Ok, so is this a known bug already fixed?
 [2002-10-27 12:58 UTC]
likely, but as you're not testing the latest snapshot with the correct apache you can't verify it for us.
 [2002-10-27 13:04 UTC] tomasr at centrum dot cz
So, please give me the time to make the snapshot working...
 [2002-10-27 13:14 UTC] tomasr at centrum dot cz
Using that snapshot the rewinddir() works fine. Thank you
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 17:01:23 2021 UTC