Non existing and undeletable folder appears with readdir()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tehhparadox
Forum Newbie
Posts: 18
Joined: Thu Oct 01, 2009 11:55 am

Non existing and undeletable folder appears with readdir()

Post by tehhparadox »

Hi all

In my script I use opendir and readdir to get a list of folders in a specific directory.
However, someone created a folder which seems to be non existing, and I can't read the files in it or delete it.
That 'ghost' folder is listed in readdir(), as well as inside its parent folder in Filezilla.
However, trying to unlink() the folder throws "No such file or directory" error, and trying to delete it from Filezilla also throws an error saying "Failed to retrieve directory listing".
What can I do to delete this?

Thanks
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: Non existing and undeletable folder appears with readdir

Post by phphelpme »

If you cant delete it with your ftp software, or your control panel built in ftp functions and your scripts can not either find it nor delete it then contact your hosting provider and ask them what this folder is because it could be something they have created or it could be an error on your account.

I get this sometimes and it turns out that my FTP program has not refreshed my server image correctly so I have to restart the FTP software to solve the issue.

Best wishes
Post Reply