php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7573 closedir keeps directory open
Submitted: 2000-11-01 14:56 UTC Modified: 2000-11-05 06:21 UTC
From: jase at sensis dot com Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.3pl1 OS: Linux 2.2.17
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jase at sensis dot com
New email:
PHP Version: OS:

 

 [2000-11-01 14:56 UTC] jase at sensis dot com
I have some code that mounts a remote file system, gets a directory listing, and then unmounts the file system.

After upgraded to php 4.0.3pl1 from php3, the code did not work.  Specifically, I could not unmount the file system.  After looking into this, I discovered that even though I called closedir, the directory was still in use, and therefore could not be unmounted.

This little code segment below shows the problem:
<?
$dh = opendir(".");
closedir($dh);
sleep(30);
?>

During the sleep, which is after the closedir, I did a lsof, and found the following:

apache    444 root    5r   DIR       3,65     1024    47110 /usr/local/www-data/normal/htdocs

To get around this, I put the code which opens, reads, and closes the directory into it's own function.  It appears that when the function completes, the directory is really closed, and I can unmount the file system.

Let me know if you need any more info.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-03 12:25 UTC] sniper@php.net
I can not reproduce  this with latest CVs.
Could you try it out?

--Jani
 [2000-11-04 09:59 UTC] thies@php.net
fixed in CVS.
 [2000-11-05 06:21 UTC] stas@php.net
Close if fixed.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Dec 01 12:02:32 2020 UTC