|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-02-16 22:07 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
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.