Cannot Delete Folders (Directories) in FTP


#1

Hello,

Some folders on my server cannot be deleted. I’m trying to delete the folder that my blog was in, and start clean. Little folders inside of it (such as “CSS” and “Images”) refuse to be deleted. I’ve checked and toyed with the folder permissions. No luck so far.

I’ve tried using FileZilla and CoreFTP.

Has anyone else experienced this? Does anyone have any ideas?

Thanks,
BrightHearted


#2

Do you have the ‘hidden’ .htaccess file or other files starting with a period in them? You can’t delete a directory that is not empty.

Also, make sure the permission on the parent directory are set OK. You have to have ‘execute’ privileges on a directory to remove files from it. And if this was a one-click install, check to see if the user is root or dhapache or something else than the one you logged in as.

Customer since 2000 :cool: openvein.org


#3

Thanks for the quick reply.

There are no hidden files in these folders. Does a directory really need to be empty to be deleted? This WordPress directory had hundreds of subfolders, and 98% of them were deleted (with files inside them). But for what it’s worth, these folders are empty.

I didn’t use a one click install. I also have a folder called “sandbox” that I used for testing scripts and tutorials, and it is empty and it too will not be deleted. In my 3-4 years with DreamHost, I’ve never experienced this before.

EDIT–

I’ve set the folders to 755 and 777 and they still cannot be deleted.

DOUBLE EDIT–
I had “view hidden files” set to true, but I couldn’t see anything. BUT, I logged into the Web-Based FTP, and there were hidden MAC OS OX created “DS Store” files in these directories. So I deleted them using webFTP. Everything is fine now.

Thanks for the help Atropos7!


#4

Glad that got sorted, its weird you didn’t get a “directory not empty” error message (if it was permissions you should get a “permission denied” error message) much less ‘see’ those hidden files.

Yes, a directory most be empty to delete it. Software that ‘deletes a directory’ will resort to recursion in order to traverse the directory tree, deleting all the subdirectories and files first. If the software doesn’t do that, you’ll get a “Directory not empty” error message. FTP/SFTP software does this but you’d have to look under the hood to see it. In the log below is a result of deleting “test” which had two files in it (emphasis to show files removed then directory removed):

Deleting file "test". Listing directory "/home/.glob/username/test". Type: SSH_FXP_OPENDIR, Size: 40, Number: 5131 Type: SSH_FXP_STATUS, Size: 24, Number: 4868 Discarding reserved response[ Type: SSH_FXP_HANDLE, Size: 13, Number: 5131 Type: SSH_FXP_READDIR, Size: 13, Number: 5388 Type: SSH_FXP_NAME, Size: 403, Number: 5388 Type: SSH_FXP_READDIR, Size: 13, Number: 5644 Type: SSH_FXP_STATUS, Size: 28, Number: 5644 Status/error code: 1 Type: SSH_FXP_CLOSE, Size: 13, Number: 5892 Deleting file "test/b". [b]Type: SSH_FXP_REMOVE, Size: 42, Number: 6157[/b] Type: SSH_FXP_STATUS, Size: 24, Number: 5892 Discarding reserved response Type: SSH_FXP_STATUS, Size: 24, Number: 6157 Status/error code: 0 [b]Deleting file "test/a".[/b] [b]Type: SSH_FXP_REMOVE, Size: 42, Number: 6413[/b] Type: SSH_FXP_STATUS, Size: 24, Number: 6413 Status/error code: 0 [b]Type: SSH_FXP_RMDIR, Size: 40, Number: 6671[/b] Type: SSH_FXP_STATUS, Size: 24, Number: 6671 Status/error code: 0 Listing directory "/home/.glob/username". Type: SSH_FXP_OPENDIR, Size: 35, Number: 6923 Type: SSH_FXP_HANDLE, Size: 13, Number: 6923 Type: SSH_FXP_READDIR, Size: 13, Number: 7180 Type: SSH_FXP_NAME, Size: 5039, Number: 7180 Type: SSH_FXP_READDIR, Size: 13, Number: 7436 Type: SSH_FXP_STATUS, Size: 28, Number: 7436 Status/error code: 1 Type: SSH_FXP_CLOSE, Size: 13, Number: 7684

Customer since 2000 :cool: openvein.org


#5

Wow, you learn something new everyday. Thank you for teaching me one of the basics of FTP usage, I never knew that before! Sometimes we rely on software so much that we don’t really know how things work.

Thanks again,
BrightHearted


#6

Will someone please help me. I’m aslo trying to use filezilla to manually delete a block from my moodle. I uploaded this via ftp four nights ago BUT it was faulty. It has missing links and I need to remove it. I’ve tried doing it directly from my moodle site, no luck, it keeps showing.

The plug in is still showing up after I deleted the files manually (highlighting the file and right clicking to select delete.) BUT is still shows up! I’m fairly new to this, please help.