Page 1 of 1

delete folder with ftp problem

Posted: Sun Apr 18, 2004 12:45 pm
by potato
Hi,

i try to delete a folder with aceftp and i get the following error:

550: Directory not empty
Unable to remove folder "/httpdocs/artists/boe", continuing anyway...


I even tried it with cuteftp pro, but the same thing.
How can i fix that, or why is it?
Greetz,

tom

Posted: Sun Apr 18, 2004 1:17 pm
by phice
Looks like a hidden file (.htacces or the like) is still in the folder. Change the settings on your FTP program so that you can see hidden files.

Posted: Sun Apr 18, 2004 1:22 pm
by potato
No, its a folder created automatic by the server when a user signs in.
Some of the folders are rwxr-xr-x :: those folders i can open & delete.

But some of them are rwx----- :: those folders i can't.

It's something with the restrictions i think.

And why are they not maked all rwxr-xr-x like it should be?

Posted: Thu May 13, 2004 8:00 am
by phait
I'm guessing that the ones with one set of rwx have possibly been created by a user on the server that you or the user running apache are no part of in a group. Therefore it will not let you delete them as there are no permissions set for a group or world, just for that user.

Like I said it's a 'guess' but that would eb where I would start. If you can get rid of the other folders with more permissions then that implies to me that you are at least part of the same group as the suer that created those folders or they have world execute rights.. which I think they do have as the last 'x' is showing. e.g. rwxr-xr-x. breaking it down I think it can be read like this:

rwx - the user who created the folder cna do what they want
r-x - any user part of the same group as the group associated with the folder can read and execute the folder
r-x - any user can read and execute the folder, does not have to be in the same group that owns the folder

might help..... :\

Posted: Fri May 14, 2004 1:19 am
by timvw
So you could try to let the server delete the directory.

Code: Select all

<?php
function deldir($dir) {
  $handle = opendir($dir);
	while (false!==($FolderOrFile = readdir($handle))) {
		if($FolderOrFile != "." && $FolderOrFile != "..") { 
			if(is_dir("$dir/$FolderOrFile")) { 
				deldir("$dir/$FolderOrFile"); 
			}  else { 
				unlink("$dir/$FolderOrFile"); 
			}
		} 
	}
	closedir($handle);

	if(rmdir($dir)) { 
		$success = true; 
	}
	return $success; 
}
?>