Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65032 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99109 invoked from network); 18 Jan 2013 15:44:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2013 15:44:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=wowkise@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=wowkise@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: wowkise@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:58875] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/99-24194-FED69F05 for ; Fri, 18 Jan 2013 10:44:49 -0500 Received: by mail-la0-f53.google.com with SMTP id fn20so3947698lab.26 for ; Fri, 18 Jan 2013 07:44:44 -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=TePs3UjxRXXmTlS5qsI6+J2wwFnBpVas7hWo2UqR8fo=; b=JT++DG7Cpn6gs9w2ntTi1KMXGn/f6106V0v7H6R5suyIhCsLulwOgq9sP9UpPkNYOV 3BONplO0UElMDVx6RQsxI2/4g48m/ZehxYfRcwSneVl2izedbjaBWiSQeGSHunIU83XS RIsvmiCAvkL3ShmmoImM3D0k5irLGVWpr0MAsM54cVWJXfqz0G2/8CEorIIdT1/kA5SH lBlNT8bS5QIC+Pit7OVh0Sh5oKVG0fM+i9/323XpfhfjN+NZ+BqfXjeclP0XKK5Qvadi EV8yLg/2D5olst17l9TlHAS4K7x/7MG9wO0QDMvOVepjK/V/uAHJYP28Ve58T9UtjIe2 +BPA== MIME-Version: 1.0 X-Received: by 10.152.124.15 with SMTP id me15mr8991396lab.5.1358523884203; Fri, 18 Jan 2013 07:44:44 -0800 (PST) Received: by 10.112.76.229 with HTTP; Fri, 18 Jan 2013 07:44:44 -0800 (PST) In-Reply-To: References: <3F59B8D4-01A9-4B97-89D0-4DC21B58F1C0@php.net> Date: Fri, 18 Jan 2013 18:44:44 +0300 Message-ID: To: Marco Pivetta Cc: Paul Dragoonis , PHP Internals List Content-Type: multipart/alternative; boundary=f46d04374581896e6004d391fdc6 Subject: Re: [PHP-DEV] new FTP function From: wowkise@gmail.com (KISE) --f46d04374581896e6004d391fdc6 Content-Type: text/plain; charset=ISO-8859-1 hello Marco Pivetta, while the implementations you linked indeed works, it also kinda big and involve changing the error handler just so that it doesn't show the error, which i think is not the way to do it. i think there should be simple way to check like "is_dir" or "is_file". anyway thanks for the hints, i have sent request to bugs.php.net, and i dont like to spam the dev list since they quite busy already PS: and sorry for the grammar errors, English is not my native tongue. On Fri, Jan 18, 2013 at 6:37 PM, Marco Pivetta wrote: > 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); >> > } >> > >> > > --f46d04374581896e6004d391fdc6--