#36423 [Opn->WFx]: Suggestion for FTP functions
| From: | bjori@php.net | Date: | Fri, 17 Feb 2006 17:08:18 +0000 |
| Subject: | #36423 [Opn->WFx]: Suggestion for FTP functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93380@lists.php.net to get a copy of this message | ||
ID: 36423
Updated by: bjori@php.net
Reported By: bholbrook at servillian dot com
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Red Hat v?
PHP Version: 4.4.2
New Comment:
These can easily be emulated in userspace as is.
function ftp_file_exists($ftp, $file) {
$tmp = ftp_nlist($ftp, $file);
return is_array($tmp) ? true : false;
}
function ftp_is_dir($ftp, $dir) {
return @ftp_chdir($ftp, $dir. "/..");
}
function ftp_is_file($ftp, $file) {
$tmp = ftp_nlist($ftp, $file);
return is_array($tmp) && count($tmp) == 1 ? true : false;
}
If this were to be implemented at extension level the code would
probably do the exact same thing.
Can't see any reason to implement it.
Previous Comments:
------------------------------------------------------------------------
[2006-02-16 22:07:07] bholbrook at servillian dot com
Description:
------------
Suggestion for additional FTP functions
ftp_is_dir(), ftp_file_exists(), ftp_is_file().
Currently can be accomplished by
if(!ftp_chdir()), if(!ftp_mdtm())
but has some effects on true that can cause additional coding. Sorry if
this is the wrong place for it (please let me know where to send these
so that I dont repeat this mistake)
Thanks.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36423&edit=1