Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65031 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95550 invoked from network); 18 Jan 2013 15:38:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2013 15:38:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.48 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.48 mail-vb0-f48.google.com Received: from [209.85.212.48] ([209.85.212.48:34809] helo=mail-vb0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/D8-24194-75C69F05 for ; Fri, 18 Jan 2013 10:37:59 -0500 Received: by mail-vb0-f48.google.com with SMTP id fc21so3716522vbb.7 for ; Fri, 18 Jan 2013 07:37:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=vS2jAAFlYIJOSHVLvXgym4MXGWYDe28E9TNK+ek11y4=; b=MReh04Nbj2BT4s9uzt/J45Q1S8A3XEwa67GA2dneU5yn6IT/btNIQ4fjY7CvB0yJmt tYgJdSfeG1U4K4VoqTxzyI6wMru3oPl05gDWEnm0CWv2EJFRW9LSuWFenXvULD+Wzwbk 0g9afw6/TtUm1L8XqTeK1TKsiP681aJ1cfSq8T0Cfx1ukwABGZLTp1tdMnZG/gL8avfJ aUjxgD2KByWCJRE9aLUwGYd9ua3F9hktlt27l8cO2FxmVzxA/z/V6wBOGQxYtEGiZYga dQYHPpbygRw4ayrwinDZFvRf2gNFl1RTQ53rMifLrfrAU14KsbpHSzcqJwX0Oeo9X6nI U2mQ== X-Received: by 10.221.12.138 with SMTP id pi10mr10050142vcb.18.1358523476833; Fri, 18 Jan 2013 07:37:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.118.52 with HTTP; Fri, 18 Jan 2013 07:37:36 -0800 (PST) In-Reply-To: References: <3F59B8D4-01A9-4B97-89D0-4DC21B58F1C0@php.net> Date: Fri, 18 Jan 2013 16:37:36 +0100 Message-ID: To: KISE Cc: Paul Dragoonis , PHP Internals List Content-Type: multipart/alternative; boundary=bcaec54eedee41778004d391e502 Subject: Re: [PHP-DEV] new FTP function From: ocramius@gmail.com (Marco Pivetta) --bcaec54eedee41778004d391e502 Content-Type: text/plain; charset=UTF-8 Heya KISE, I just checked a bit around and found that current implementations actually simply deal with the warning: https://github.com/rjkip/ftp-php/blob/master/src/FtpPhp/FtpClient.php#L172-L186 https://github.com/rjkip/ftp-php/blob/master/src/FtpPhp/FtpClient.php#L92-L116 What kind of problems is the warning currently causing in your code? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 18 January 2013 16:33, KISE wrote: > 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); > > } > > > --bcaec54eedee41778004d391e502--