Bug #39485 [NoF->Fbk]: mkdir() fails when pathname have space(s) on the final
| From: | felipe@php.net | Date: | Wed, 14 Jul 2010 01:50:30 +0000 |
| Subject: | Bug #39485 [NoF->Fbk]: mkdir() fails when pathname have space(s) on the final | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152385@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=39485&edit=1
ID: 39485
Updated by: felipe@php.net
Reported by: v1d4l0k4 at gmail dot com
Summary: mkdir() fails when pathname have space(s) on the final
-Status: No Feedback
+Status: Feedback
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows XP (Win32 only)
PHP Version: 5.2.0
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2006-11-29 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-11-21 21:03:31] tony2001@php.net
Cannot reproduce:
C:\>php -r "var_dump(mkdir('dirname '));"
bool(true)
------------------------------------------------------------------------
[2006-11-13 04:29:24] v1d4l0k4 at gmail dot com
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 this bug report at http://bugs.php.net/bug.php?id=39485&edit=1