|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-07-21 14:19 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2021-07-21 14:19 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 04:00:02 2025 UTC |
Description: ------------ It would be really useful if the mkdir function with the $recursive parameter set to TRUE would behave the same way as mkdir -p command on linux. The difference between the two is that mkdir -p does not report an error if the directory already exists while the php version does. And triggering a WARNING seems a bit too much, why not trigger a NOTICE or nothing at all when the directory already exists? If backwards compatibility is a concern then we can create a new function called "mkdirp($path, $perm)". Test script: --------------- <?php var_dump(mkdir('/tmp/a/b/c/d/', 0777, true)); var_dump(mkdir('/tmp/a/b/c/d/', 0777, true)); Expected result: ---------------- bool(true) bool(true) Actual result: -------------- bool(true) bool(false)