![]() |
bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: bug / feature? $this->ftp->delete_dir() won't delete non-empty directory (/showthread.php?tid=6602) |
bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 03-05-2008 [eluser]HdotNET[/eluser] Hi there, Just encountered this: Code: $config['hostname'] = 'democrat.ftp.server'; This fails for me, yet in the guide it states: Quote: FTP class in user guide If someone could test this out I'd be very grateful. Am using CI 1.6.1 bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 03-05-2008 [eluser]HdotNET[/eluser] k... I think I've fixed it. Code: function delete_dir($filepath) bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 03-05-2008 [eluser]HdotNET[/eluser] doh... forgot to say what I fixed! This bit: Code: // If we can't delete the item it's probaly a folder so The code was like this: Code: // If we can't delete the item it's probaly a folder so which meant if you passed the function /path/to/dir/ it would try and delete /path/to/dir/path/to/dir/file bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 03-05-2008 [eluser]Seppo[/eluser] Hey, I've filled a bug report for this one. Please check if it's OK. http://codeigniter.com/bug_tracker/bug/4215/ bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 04-25-2008 [eluser]mdriscol[/eluser] thanks for this! I was having the same problem. This is an easy fix so hopefully it will be in the next update. bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 04-25-2008 [eluser]Elliot Haughin[/eluser] Good catch HdotNet. Looks like a valid bug to me! I'll give it a try tonight. bug / feature? $this->ftp->delete_dir() won't delete non-empty directory - El Forum - 07-09-2013 [eluser]Unknown[/eluser] [quote author="HdotNET" date="1204732573"]doh... forgot to say what I fixed! This bit: Code: // If we can't delete the item it's probaly a folder so The code was like this: Code: // If we can't delete the item it's probaly a folder so which meant if you passed the function /path/to/dir/ it would try and delete /path/to/dir/path/to/dir/file[/quote] If you do it like so your will get paths like: public_html/dir_name/./ public_html/dir_name/././ public_html/dir_name/./././ So this is endless recursion and you need do some checks Code: if ($list !== FALSE AND count($list) > 0) { |