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:

function rrmdir($dir)
{
	[COLOR="#FF0000"]$fp = opendir($dir);[/COLOR]
	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?

What permissions are set on that folder, and for what accounts?

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 :slight_smile: