Req #67020 [Opn->Wfx]: Lower severity of error when directory already exists

From: Date: Sun, 13 Apr 2014 11:35:26 +0000
Subject: Req #67020 [Opn->Wfx]: Lower severity of error when directory already exists
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185210@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67020&edit=1 ID: 67020 Updated by: tyrael@php.net Reported by: spam06 at geekhood dot net Summary: Lower severity of error when directory already exists -Status: Open +Status: Wont fix Type: Feature/Change Request Package: Directory function related Operating System: * PHP Version: 5.6.0alpha3 Block user comment: N Private report: N New Comment: hi, mkdir failing can be a serious issue when you pass a specific $mode and if the directory already exists, the mode won't be changed for that. putting all this aside, this is how it work since the beginning, so I don't really see it worthwile to change it without any significant gain. if you are not interested in the success of the mkdir call, or why exactly it failed, you can call it with the error supression(@) operator. if you still think that you want to push this change, please write an rfc and start a discussion on the mailing list to gauge what others think about this idea. Previous Comments: ------------------------------------------------------------------------ [2014-04-04 13:35:56] spam06 at geekhood dot net Description: ------------ Currently when mkdir() finds that the directory already exists it triggers E_WARNING. IMHO this is unnecessarily high severity, as the error is generally harmless. The whole point of this function is to make the directory exist. I suggest lowering the severity to E_NOTICE. Test script: --------------- <?php mkdir("test"); mkdir("test"); Expected result: ---------------- Notice: mkdir(): File exists Actual result: -------------- Warning: mkdir(): File exists ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67020&edit=1

« previous php.bugs (#185210) next »