Forum Moderators: coopster

Message Too Old, No Replies

rmdir not working

         

dougmcc1

4:07 am on Aug 17, 2006 (gmt 0)

10+ Year Member



I'm trying to delete folders on my website that were created using a script.

The code being used to create the folders is simply:
mkdir($new_folder, 0755);

The code I'm using to delete the folder is:
$rmdir = "rm -rf $path";
`$rmdir`;
if($rmdir) {
echo $path." deleted<BR>";
} else {
echo $path." not deleted<BR>";
}

Also, rmdir($path) doesn't work. Can I modify the script so that the folder gets deleted or do I need to make some changes to php.ini or other server file?

eelixduppy

4:22 am on Aug 19, 2006 (gmt 0)



With rmdir [us2.php.net]:

The directory must be empty, and the relevant permissions must permit this.

Just make sure this is the case before making yourself crazy changing things that don't need to be changed ;)