Page 1 of 1
[SOLVED] minor question about closedir()
Posted: Fri Nov 28, 2003 12:57 pm
by bckennyw
I really wonder what it is for. 'cuz like... say I do...
and if I wanna delete it, I don't have to call the closedir($dir) before doing the rmdir($dir).
What is that for anyways?
Posted: Fri Nov 28, 2003 4:50 pm
by McGruff
I could be wrong but, as far as I understand it, you should get an error if you don't close the stream before rmdir().
What error reproting level do you have? Should always develop with E_ALL.
Posted: Sat Nov 29, 2003 11:16 am
by bckennyw
Hm... I am not sure 'cuz I posted the script (PHP) with a hosting company. How could I find out?
And yes... I'm pretty sure that if I do closedir($dir) before deleting it, then I'll have error; no error otherwise... it's SO weird and doesn't make any sense.
Posted: Sat Nov 29, 2003 3:35 pm
by McGruff
Check out [php_man]ini_get()[/php_man] to examine the host php.ini file.
opendir opens a stream - hence the error when you try to delete a directory for which a stream is currently open.