SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    What does it means when a dir cannot be opened

    I'm trying to open a dir from inside a function and i always get this error:
    failed to open dir: Resource temporarily unavailable

    this is the function, line of error marked in red:
    Code:
    function rrmdir($dir)
    {
    	$fp = opendir($dir);
    	if ($fp)
    	{
    		while ($f = readdir($fp))
    		{
    			$file = $dir . '/' . $f;
    			if ($f == '.' || $f == '..')
    				continue;
    			else if (is_dir($file) && !is_link($file))
    				rrmdir($file);
    			else
    				unlink($file);
    		}
    		closedir($fp);
    		rmdir($dir);
    	}
    }
    what does it means and how can i solve that?

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What permissions are set on that folder, and for what accounts?
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    was my fault, seems like my code was trying to recuresivly delete the same folder a couple of times within a small period of time, thats what caused this error.
    problem is solved.

    Hi siteguru btw, nice to see you


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •