Paul Dragoonis,

Actually it wont work i did tried it before, if the dir end with / it will
list the directories inside the path you gave it and if it doesn't have any
directories it will return false since there is no directories to return.

you have to take out the last / and then remove the directory in question
and list the files in the parent directory and check if the dir exists
otherwise it will return false, i spent 3hrs yesterday thinking why its
returning false even though the directory exists.

On Fri, Jan 18, 2013 at 6:28 PM, Paul Dragoonis <dragoo...@gmail.com> wrote:

>
> On Fri, Jan 18, 2013 at 3:18 PM, KISE <wowk...@gmail.com> wrote:
>
>>         $res  = ftp_nlist($this->conn_id, '-dF '. $dir);
>>
>
> This could be done in two lines.
>
> function dir_exists($conn, $dir) {
>         $list  = ftp_nlist($conn, '-dF '. $dir);
>         return in_array($dir, $list);
> }
>

Reply via email to