Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65030 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93754 invoked from network); 18 Jan 2013 15:34:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2013 15:34:04 -0000 Authentication-Results: pb1.pair.com header.from=wowkise@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=wowkise@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: wowkise@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-la0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:48586] helo=mail-la0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/88-24194-A6B69F05 for ; Fri, 18 Jan 2013 10:34:03 -0500 Received: by mail-la0-f42.google.com with SMTP id fe20so4040920lab.1 for ; Fri, 18 Jan 2013 07:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=tj1jOnJdGyW1J+KMVwH3pgBpihsQJ5g737Re/ZpsS4Y=; b=ZBPsC7Yvly56S8z8CjZ+8soFebGuCtW7VNzZDgAeE22Jeqp0gNg0hlKfddJq1UpEnh pifh+XzBuBcUjZWf38+f47KhNZUlaYJU3UJG64aAKh6igsMyEba6gqZwtRPLY56VW/W6 FUpxCuVcOdD85iw3V2AXDH+ynQHVNo/FmEVt28C+M/uZgn2979Skrup0NmmNxtzeseTX xIpXydam/egy+YY1sddECnG2Qkf8AUJ+Gd4YFqsYxRuUHxSWtuQfy51+a1bS3K4mAV1k OGxlguEBjK/v1s8LI87q1CsR+lH/7yfaigUo76VQWhEe9xQ+Tzte/HBPNcQhI/665sz2 x6BA== MIME-Version: 1.0 X-Received: by 10.152.147.103 with SMTP id tj7mr8880640lab.54.1358523239385; Fri, 18 Jan 2013 07:33:59 -0800 (PST) Received: by 10.112.76.229 with HTTP; Fri, 18 Jan 2013 07:33:59 -0800 (PST) In-Reply-To: References: <3F59B8D4-01A9-4B97-89D0-4DC21B58F1C0@php.net> Date: Fri, 18 Jan 2013 18:33:59 +0300 Message-ID: To: Paul Dragoonis Cc: PHP Internals List Content-Type: multipart/alternative; boundary=e89a8f234d2b1a490104d391d73e Subject: Re: [PHP-DEV] new FTP function From: wowkise@gmail.com (KISE) --e89a8f234d2b1a490104d391d73e Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > > On Fri, Jan 18, 2013 at 3:18 PM, KISE 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); > } > --e89a8f234d2b1a490104d391d73e--