php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73642 ftp_mkdir make an error if folder exist
Submitted: 2016-12-02 10:34 UTC Modified: 2016-12-04 22:13 UTC
From: pottierbaptiste at gmail dot com Assigned:
Status: Open Package: FTP related
PHP Version: 7.0.13 OS: mac OSX
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: pottierbaptiste at gmail dot com
New email:
PHP Version: OS:

 

 [2016-12-02 10:34 UTC] pottierbaptiste at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.ftp-mkdir
---

In document is written that ftp_mkdir return false is folder already existe it seems to be false, it's an error i have to write it with a "@":


if (@ftp_mkdir($conn_id, $myfolder)) {
            echo "$myfolder has been created > success ";
        } else {
            echo "oups, there is a probleme...";
        }


Test script:
---------------
if (@ftp_mkdir($conn_id, $myfolder)) {
            echo "$myfolder has been created > success ";
        } else {
            echo "oups, there is a probleme...";
        }


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-02 11:16 UTC] requinix@php.net
-Status: Open +Status: Feedback -Package: PHP Language Specification +Package: FTP related
 [2016-12-02 11:16 UTC] requinix@php.net
Are you saying that PHP emits a warning when the mkdir fails? What is the message?
 [2016-12-04 14:02 UTC] pottierbaptiste at gmail dot com
-Status: Feedback +Status: Open
 [2016-12-04 14:02 UTC] pottierbaptiste at gmail dot com
Yes indeed. Thks is rxactly that i rrceive a "warning". Thks is really easy to test. I should have a return to "false" and i have a warning ( error and cancel the process )
 [2016-12-04 22:13 UTC] cmb@php.net
-Summary: ftp_mkdir make an error if fodler exist +Summary: ftp_mkdir make an error if folder exist
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Nov 18 21:01:37 2019 UTC