0 votes
by (160 points)
edited

Hello, When I try to delete a directory which contains only one file eg. 'Thumbs.db'. then I get an exception like directory is non empty. When I call GetList() it does not return the system files so how can I solve this issue? Is there any way to force delete directory or can I get a list of hidden files?

thanks!

1 Answer

0 votes
by (58.9k points)
edited

Hello, it happens quite often on unix FTP servers that hidden files are not listed. There is an option 'ForceListHiddenFiles' which forces such servers to list also hidden files. Please use it like this:

        Ftp ftp = new Ftp();
        ftp.Settings.ForceListHiddenFiles = true;

        // connect & login

        foreach (var item in ftp.GetList())
            Console.WriteLine(item.Name);

        ftp.Disconnect();

Does GetList() method return also 'Thumbs.db' now?

...