#39485 [NEW]: mkdir() fails when pathname have space(s) on the final

From: Date: Mon, 13 Nov 2006 04:29:24 +0000
Subject: #39485 [NEW]: mkdir() fails when pathname have space(s) on the final
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104871@lists.php.net to get a copy of this message
From: v1d4l0k4 at gmail dot com Operating system: Windows XP (Win32 only) PHP version: 5.2.0 PHP Bug Type: *Directory/Filesystem functions Bug description: mkdir() fails when pathname have space(s) on the final Description: ------------ The 'mkdir' function doesn't function correctly on Windows when the pathname contain space(s) on the final. PHP returns a warning, and the directory isn't created: Warning: mkdir() [function.mkdir]: Invalid argument in X on line Y Temporary fix: use trim() on the pathname Besides, if the pathname contain space(s) on the start, the directory is created when couldn't even so (in accordance with the behavior of Windows Explorer). Reproduce code: --------------- <?php mkdir('pathname '); mkdir(' pathname'); ?> Expected result: ---------------- <?php mkdir('pathname '); // Succeeds, but trim() before, in accordance with the behavior of Windows Explorer mkdir(' pathname'); // Succeeds, but trim() before, in accordance with the behavior of Windows Explorer ?> Actual result: -------------- <?php mkdir('pathname '); // Fails mkdir(' pathname'); // Succeeds even not being recommended ?> -- Edit bug report at http://bugs.php.net/?id=39485&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39485&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39485&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39485&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39485&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39485&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39485&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39485&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39485&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39485&r=support Expected behavior: http://bugs.php.net/fix.php?id=39485&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39485&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39485&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39485&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39485&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39485&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39485&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39485&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39485&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39485&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39485&r=mysqlcfg

« previous php.bugs (#104871) next »