php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29274 mkdir() failed to create dir
Submitted: 2004-07-20 10:59 UTC Modified: 2005-02-22 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: ca50015 at yahoo dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 5.0.0 OS: windows 98 se
Private report: No CVE-ID: None
 [2004-07-20 10:59 UTC] ca50015 at yahoo dot com
Description:
------------
mkdir() wont work properly when its parameter is a numeric string

Reproduce code:
---------------
<?php
$path = array('1/0/0001', '1/1/0001');
$cwd = getcwd();
foreach ($path as $p)
{
	$p = explode('/', $p);
	foreach ($p as $dir_name)
	{
		if (! is_dir("./$dir_name"))
		{
			mkdir("./$dir_name");
		}
		chdir("./$dir_name");
	}
	chdir($cwd);
}
?>


Expected result:
----------------
It should create two directory trees under current dir:
   1/0/0001
   1/1/0001




Actual result:
--------------
and the result is:
   1/0/0001    (correct)
   1/0001      (should be '1/1/0001')


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-22 01:00 UTC] 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 09:01:27 2024 UTC