rmdir

How to remove folder with PHP?

I can create a image folder when I create a category, so that I can upload images there. Now I want to delete that folder when I delete the category. Code for creating a folder is the following and works well. function create(){ if ($this->input->post('name')){ $this->MCats->addCategory(); $folder = $this->input->post('name');...

How to remove files and directories quickly

I am using a mac. When I use the "rm" command it can only remove files. The "rmdir" command only removes empty folders. If you have a directory with files and folders with files and folders in them and so on. Is there anyway to delete all the files and folders without all the strenuous command typing? Remember, I am using the mac bash sh...

PHP: delete directory with files in it?

hey guys, i wonder what's the easiest way to delete a directory with all it's files in it? i'm using rmdir(PATH . '/' . $value); to delete a folder. however if there are files inside of it, i simply can't delete it. regards ...

Delete files then directory | PHP

I have this so far: <?php $path = "files/"; $files = glob("" . $path . "{*.jpg,*.gif,*.png}", GLOB_BRACE); $i = 0; foreach($files as $file) { $delete = unlink($file); if($delete) { echo $file . " deleted!<br />"; $i - 1; } else { echo $file . " could not be deleted...<br />"; ...

php wont delete 775 dir chmod

OK help me understand this. I have 2 users in my linux system that are BOTH part of "web-users" group. one is www-data used by the webserver and php-cgi one is my ftp-user when I upload files via ftp they are set to 775 for dirs and 664 for files, when I run a script on the server (so same group like the ftp user) to delete that direc...