Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65025 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84338 invoked from network); 18 Jan 2013 15:04:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2013 15:04:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.45 as permitted sender) X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.216.45 mail-qa0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:49936] helo=mail-qa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/D6-24194-99469F05 for ; Fri, 18 Jan 2013 10:04:58 -0500 Received: by mail-qa0-f45.google.com with SMTP id bv4so1391630qab.11 for ; Fri, 18 Jan 2013 07:04:55 -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=W/C39Fspgu4mpAf7pH6YZQjPc7xzmcLBEjUqjijwN0c=; b=IflgqPPr2bWxzDWfQEZLO7Kf8OdMCdrOPbuLYaspOl24+wKjaOm2QKneKXUpgAq7bo AkXIUAdRkM0RGgB3eh9D+ONJxbuHSbmQniEev90SZA/OqlSO+H4C4EnD/CPTyucgsGY8 Vd5zZUGR4di73jtDws3Y6avb7BfigKwa2CQrSLpPuJNOvEAiPRGtBU9p+ypL+0CaMDH9 0G5ll2HgeSNT/V7E+QVmhUn/w0XI6q5zkgDacJbI0cdXNZg9hFXlECsxgo4y9cmNddjm 0tkpnaWolaHDh6WWssByq/R84Qe8dR3y77cJo8AyWmOU0Ko8sFvj92WPSAavtFb4QJNP BGTg== MIME-Version: 1.0 X-Received: by 10.224.181.135 with SMTP id by7mr9687150qab.51.1358521494999; Fri, 18 Jan 2013 07:04:54 -0800 (PST) Received: by 10.229.126.75 with HTTP; Fri, 18 Jan 2013 07:04:54 -0800 (PST) In-Reply-To: <3F59B8D4-01A9-4B97-89D0-4DC21B58F1C0@php.net> References: <3F59B8D4-01A9-4B97-89D0-4DC21B58F1C0@php.net> Date: Fri, 18 Jan 2013 15:04:54 +0000 Message-ID: To: Will Fitch Cc: KISE , PHP Internals List Content-Type: multipart/alternative; boundary=20cf30363efb2112da04d3916f5a Subject: Re: [PHP-DEV] new FTP function From: dragoonis@gmail.com (Paul Dragoonis) --20cf30363efb2112da04d3916f5a Content-Type: text/plain; charset=ISO-8859-1 I don't believe there's a feature of the FTP protocol to check if a file/folder exists. Can you please provide a PHP userland solution to this, so that a corresponding C implementation could be added. I believe the way to go about it is list the CWD contents and check if that exists and is of type DIR. You must also make sure that if a file exists with the name of the directory you want to check it has to handle that properly, it can't simply return true or false. If false then that means you could create it because it doesn't exist. If true it means you can CD into it and put stuff there, which is also not true. Thanks, Paul. On Fri, Jan 18, 2013 at 3:00 PM, Will Fitch wrote: > > On Jan 18, 2013, at 9:53 AM, KISE wrote: > > > Hi > > > > II would like to see "ftp_dir_exists()" function in PHP, right now its > > kinda unreasonable to expect people to use hacks such as "is_dir()" and > > having to re-authenticate just to check if the dir exists, I also dont > > think its good idea to use "ftp_chdir()" just to check if the directory > > exists, because its shows errors if the directory doesn't exists. i think > > there should be a way to check if the directory exists without having to > > resort to hackish ways, or having to authenticate again. > > There are procedures in place for this. If you'd like to make a feature > request, use bugs.php.net and submit the request with the FTP extension > selected. You can also use https://wiki.php.net/rfc if you really want > to see/make the change as well. --20cf30363efb2112da04d3916f5a--