bug / feature? $this->ftp->delete_dir() won't delete non-empty directory |
[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
[eluser]HdotNET[/eluser]
k... I think I've fixed it. Code: function delete_dir($filepath)
[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
[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/
[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.
[eluser]Elliot Haughin[/eluser]
Good catch HdotNet. Looks like a valid bug to me! I'll give it a try tonight.
[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) { |
Welcome Guest, Not a member yet? Register Sign In |