php.net |  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
 [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"

Thanks,
Tomas Rubringer
tomasr@centrum.cz

<html>
<head>
<title>strange rewinddir()</title>
</head>
<body>

<?php

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

?>

</body>
</html>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-27 12:46 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-10-27 12:54 UTC] tomasr at centrum dot cz
Yes, thanks, I already tried php4-win32-latest.zip. 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] derick@php.net
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] derick@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC