From: cweiske Operating system: PHP version: 5.3.6 Package: Directory function related Bug Type: Bug Bug description:recursive mkdir fails with current (dot) directory in path
Description: ------------ Running recursive mkdir fails when there is a "." directory in the path: <?php mkdir('a/./b', 0755, true) ?> PHP Warning: mkdir(): File exists in Command line code on line 1 Warning: mkdir(): File exists in Command line code on line 1 When a does not exist, "a" is generated, but "b" is not. When a exists already, everything is fine. Note that I cannot use realpath() to sanitize the path because the path does not exist yet. Test script: --------------- Actual result: -------------- $ /opt/phpfarm/inst/bin/php-5.3.6 -v PHP 5.3.6 (cli) (built: Mar 18 2011 09:27:59) (DEBUG) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies $ LC_ALL=C ls a ls: cannot access a: No such file or directory $ /opt/phpfarm/inst/bin/php-5.3.6 -r 'mkdir("a/./b", 0755, true);' PHP Warning: mkdir(): File exists in Command line code on line 1 Warning: mkdir(): File exists in Command line code on line 1 -- Edit bug report at https://bugs.php.net/bug.php?id=55124&edit=1 -- Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55124&r=trysnapshot52 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55124&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55124&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55124&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55124&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55124&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55124&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55124&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55124&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55124&r=support Expected behavior: https://bugs.php.net/fix.php?id=55124&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55124&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55124&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55124&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55124&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55124&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55124&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55124&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55124&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55124&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55124&r=mysqlcfg Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55124&r=trysnapshot54