Loading...
 

UserPagemwexler

I will always be a newbie.

I am including code here to save me from pain.


This will probably get its own page at some point:

<?php function deldir($dir){ $current_dir = opendir($dir); while($entryname = readdir($current_dir)){ if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){ deldir("${dir}/${entryname}"); }elseif($entryname != "." and $entryname!=".."){ unlink("${dir}/${entryname}"); } } closedir($current_dir); rmdir(${dir}); } clearstatcache(); $dir='/home/tiki/templates_c/'; if (is_dir($dir)) {deldir($dir);} else {print "$dir is not a dir!";} print is_dir($dir); ?>


Call it deldir.php, set the right perms, and call it from your browser. This will completly remove the directory; prob needs mods to just clear it.


Page last modified on Thursday 09 October 2003 15:15:59 GMT-0000