delete folder with ftp problem

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

delete folder with ftp problem

Post 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
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post 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.
Image Image
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

Post 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?
phait
Forum Commoner
Posts: 46
Joined: Wed Apr 07, 2004 4:41 am
Location: watford / leicester, UK

Post 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..... :\
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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; 
}
?>
Post Reply