#25065 [Bgs]: ftp_rmdir() returns true on failure and false on success
| From: | webmaster at crovortex dot com | Date: | Tue, 12 Aug 2003 22:29:51 +0000 |
| Subject: | #25065 [Bgs]: ftp_rmdir() returns true on failure and false on success | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45816@lists.php.net to get a copy of this message | ||
ID: 25065
User updated by: webmaster at crovortex dot com
Reported By: webmaster at crovortex dot com
Status: Bogus
Bug Type: FTP related
Operating System: Win 98 SE
PHP Version: 4.3.2
New Comment:
I'm using GuildFTPd.
Theres no real problem with the function...it works(ie it deletes
directories if they exist and are empty) but just returns opposite
results. If it deletes a directory it returns false and if it doesn't
it returns true.
Previous Comments:
------------------------------------------------------------------------
[2003-08-12 16:56:51] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
This is not a PHP bug, On success the FTP server MUST return 250
response code, otherwise it is not compliant with RFC959 on File
Transfer Protocol. On that note I should mention that, just like
Pollita I am unable to replicate this bug.
------------------------------------------------------------------------
[2003-08-12 16:44:19] pollita@php.net
I can't reproduce that error here.
What FTP server are you contacting? (The ftp_rmdir() function is
looking for a response code of 250, perhaps your server is sending
something else).
Could you un-supress those error messages? When ftp_rmdir() fails it
is supposed to output a message describing the error. Seeing those
error messages would help.
Is trying a recent snapshot an option?
http://snaps.php.net
------------------------------------------------------------------------
[2003-08-12 16:32:02] webmaster at crovortex dot com
Description:
------------
PHP distribution: php-4.3.2-Win32.zip
Apache dist: apache_2.0.47-win32-x86-no_ssl.msi
When deleting empty directories function ftp_rmdir() returns true on
failure and false on success, and according to the manual it should be
the other way around. I ran the same code on PHP 4.0.1 and it worked as
it should.
Reproduce code:
---------------
$test=1;
$remdir="non_existing_dir";
if(@ftp_rmdir($spoj,$remdir)) $test++;
echo "Test=$test<br>";
$remdir="existing_dir";
if(@ftp_rmdir($spoj,$remdir)) $test--;
echo "Test=$test<br>";
Expected result:
----------------
Test=1
Test=0
Actual result:
--------------
Test=2
Test=2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25065&edit=1