php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25065 ftp_rmdir() returns true on failure and false on success
Submitted: 2003-08-12 16:32 UTC Modified: 2003-08-12 17:29 UTC
From: webmaster at crovortex dot com Assigned:
Status: Not a bug Package: FTP related
PHP Version: 4.3.2 OS: Win 98 SE
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster at crovortex dot com
New email:
PHP Version: OS:

 

 [2003-08-12 16:32 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-12 16:44 UTC] 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:56 UTC] 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 17:29 UTC] webmaster at crovortex dot com
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 22:01:27 2024 UTC