The reason is because the directory is NOT empty. It has at least one file under it somewhere that begins with a period (.) so that it is hidden or invisible to the regular ‘ls’ command.
In order to see and delete these hidden files,
1) Get a shell prompt and type:
ls -la /htdocs/www/dirname
where /htdocs/www/dirname is the full path to the directory that you are trying to delete. Doing that will show you all the hidden files inside the directory. You can then delete the hidden file individually like this:
rm -f /htdocs/www/dirname/.hiddenfile
Or you can just delete the entire directory without regard to what is still inside it by typing:
rm -rf /htdocs/www/dirname
2) To delete a directory that still has hidden files in it with your FTP program, first turn on your ability to see hidden files with your FTP program. Then click on the revealed hidden file and delete it with your FTP program as you normally would any other file. When you’ve gotten rid of all the hidden files, you will be able to delete the directory that they were under.
Files that begin with a ‘.’ are hidden. Generally, these files contain configuration information and are hidden so that they are not accidentally deleted. If you need to modify a hidden file like .htaccess, then you will need to view hidden files so you can delete and upload them.
There are several ways to edit, delete, and upload hidden files. If you are using an FTP client, you should be able to change the settings so that your hidden files are viewable.
?? or best of all if its a share account just ask your host for help!