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: 2021-02-19 14:53 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: pottierbaptiste at gmail dot com Assigned: cmb (profile)
Status: Closed Package: FTP related
PHP Version: 7.0.13 OS: mac OSX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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
 [2021-02-19 14:53 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2021-02-19 14:53 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=7786b06044cb6ab7c471f895057fe6070f3344d9
Log: Fix #73642: ftp_mkdir make an error if folder exist
 [2021-02-19 14:53 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2021-02-19 20:15 UTC] mumumu@php.net
Automatic comment on behalf of mumumu@mumumu.org
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=522089bad315a54f2c331b1fea77f30596dd5f0e
Log: Fix #73642: ftp_mkdir make an error if folder exist
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 13:01:30 2024 UTC