|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54987 rmdir() does not clear statcache
Submitted: 2011-06-03 17:29 UTC Modified: 2015-06-14 22:20 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: davey at marshallx dot fsnet dot co dot uk Assigned: cmb (profile)
Status: Closed Package: Directory function related
PHP Version: 5.3.6 OS: Windows 7 Pro 32-bit
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: davey at marshallx dot fsnet dot co dot uk
New email:
PHP Version: OS:


 [2011-06-03 17:29 UTC] davey at marshallx dot fsnet dot co dot uk
See bug 43137. The same bug applies to Windows.

Given a directory structure "C:\Test\Test2" with no files in either directory,
rmdir("C:\Test\Test2") succeeds
but subsequent
rmdir("C:\Test") fails with "directory not empty", even though it is empty.
Running clearstatcache() prior to rmdir("C:\Test") works around the problem.

Test script:
if (file_exists("C:\Test\Test2")) rmdir("C:\Test\Test2");

Expected result:
c:\Test\Test2 is deleted
C:\Test is deleted
No warnings

Actual result:
C:\Test\Test2 is deleted
C:\Test is NOT deleted
Receive warning that C:\Test is not empty


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-14 22:20 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-06-14 22:20 UTC]
Thank you for your bug report. This bug has been fixed in the
meantime (at least as of PHP 5.4.4).
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 13:01:24 2021 UTC