Forum Moderators: phranque

Message Too Old, No Replies

Delete Directory on server

How do I delete a directory

         

Hondoexpress

9:51 pm on Feb 25, 2009 (gmt 0)

10+ Year Member



I found a code online and downloaded it to my PC then put it on the server. Now I can't delete that folder. I tried changing the permissions and it always goes back to the original one drwxrw-rw- . I searched and searched on the web to find a solution but I can't seem to find one. I also put it in another folder and tried that but it did not work. The folder is empty or so it says. I get an error messsage that says that I can't delete it because it's not empty but it is!

Let me know what I can do Thanks!

choster

11:21 pm on Feb 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like there is a hidden file. Have you tried listing all contents using
ls -al
? Or trying a recursive, forced delete,
rm -rf [i]directoryname[/i]
?

rocknbil

4:02 pm on Feb 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard hondoexpress, if you have command line access, the above will work.

I get an error messsage that says that I can't delete it because it's not empty but it is!

I'm guessing by your wording you are doing this via FTP. If you do not have command line access and you're doing this from FTP, there are probably hidden files you can't view via FTP. these are generally files beginning with a dot:

.htaccess
.htpasswd

I can't train you on your software, but in one FTP program there are commands for site and quote that can pass commands to the server, and are often allowed by the server via FTP. so if you navigate inside the target directory and issue

DELE .htaccess

And get a "deleted successfully" response, you could then navigate up and try deleting the directory. .htaccess is the most likely suspect, but if it doesn't work, repeat the process with .htpasswd while inside this directory.

There may be other hidden files I could never guess at, and you'd need command line access to determine what they are. Hopefully deleting this directory doesn't break your site!