|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32516 mkdir's recursive parameter
Submitted: 2005-03-31 15:41 UTC Modified: 2005-04-06 10:41 UTC
Avg. Score:1.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: cbelin at free dot fr Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.0.3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 22 = ?
Subscribe to this entry?

 [2005-03-31 15:41 UTC] cbelin at free dot fr
What is the purpose of the 'recursive' parameter of the 'mkdir' function ?

I expected that it allow to create a directory structure recursively but it doesn't seem to work !


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-31 20:38 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

 [2005-04-01 09:21 UTC] cbelin at free dot fr
Here is a simple example of the "bug" :
mkdir("toto/tata/titi/tutu", 0777, true);

It outputs :
Warning: mkdir() [function.mkdir]: No such file or directory in D:\Serveur Web\...\toto.php on line 2

Instead, I must use successive mkdir() calls :
mkdir("toto", 0777);

mkdir("tata", 0777);

mkdir("titi", 0777);

mkdir("tutu", 0777);
 [2005-04-03 16:50 UTC]
Use appropriate slashes on Windows (i.e. DIRECTORY_SEPARATOR constant).
I doubt this behaviour will be changed ever, because "dir\name" is perfectly valid directory name on *nix. 
 [2005-04-06 10:41 UTC] cbelin at free dot fr
Yes ! It works with the proper use of DIRECTORY_SEPARATOR constant. Thanks
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 10:01:28 2024 UTC