php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6801 rmdir fails after an opendir / closedir operation
Submitted: 2000-09-18 03:55 UTC Modified: 2000-09-21 07:33 UTC
From: jeff_schnitter at peoplesoft dot com Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.2 OS: Windows NT 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jeff_schnitter at peoplesoft dot com
New email:
PHP Version: OS:

 

 [2000-09-18 03:55 UTC] jeff_schnitter at peoplesoft dot com
It seems like closedir is not correctly closing a directory handle.  rmdir will fail if you try it after calling opendir and closedir.  rmdir works fine if you don't call
opendir / closedir.

The problem does not occur in 4.0 or 4.0 pl 2.

<?
   // Run this script twice.  The first time you run it, 
   // you'll get a failure
   // that RmDir failed (Permission denied).  Run it the
   // second time and you
   // can successfully remove the directory.  It seems like 
   // closedir might
   // not be closing the directory.
   $dummyDir = "test";
   if (!is_dir($dummyDir)) {
      mkdir($dummyDir, 0777);
      $handle = opendir($dummyDir);
      closedir($handle);
   }
   rmdir($dummyDir);
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-21 07:33 UTC] sniper@php.net
I can not reproduce this. Please try latest CVS or snapshot from http://snaps.php.net
and reopen this bug report if problem still exists.

--Jani
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 09:01:28 2025 UTC