php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47579 Deleting a directory created recursively with mkdir
Submitted: 2009-03-05 20:23 UTC Modified: 2009-03-14 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: yorianbenjamin at hotmail dot com Assigned:
Status: No Feedback Package: Directory function related
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yorianbenjamin at hotmail dot com
New email:
PHP Version: OS:

 

 [2009-03-05 20:23 UTC] yorianbenjamin at hotmail dot com
Description:
------------
When using mkdir() to create a directory recursively it creates directories which can not be removed with ftp. However when I create a single directory with mkdir it is removable.

Reproduce code:
---------------
<?php

mkdir('test_dir2', 0777, FALSE);
mkdir('test_dir3', 0777, TRUE);
mkdir('test_dir4/blaat', 0777, TRUE);

?> 

Expected result:
----------------
I expected that I could easily delete all the directories using ftp.

Actual result:
--------------
Deleting the directories (using ftp): test_dir2 and test_dir3 worked as I expected it. 

Trying to delete blaat or test_dir4 returned an error:
[23:25:38] 550 blaat: Permission denied (or in the case of the other
directory: test_dir4: permission denied)

Someone else who tested it on his system replied:

This did the same thing on my machine. I had to be a superuser in order to delete it at the command line (which is essentially what you would need to do over FTP). I have no idea why that would happen.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-06 10:44 UTC] jani@php.net
Propably just a misconfigured system, but what exacty were the permissions (for ALL directories created) ? 
 [2009-03-07 00:02 UTC] yorianbenjamin at hotmail dot com
All the directories (test_dir2, test_dir3 and blaat) had 0755 as mode (because of a mask). But that's the strange thing, the directories had pretty much everything identical. When I used stat() on all the directories they were pretty much identical. The only differences were:
- different inode (which is what you'd expect)
- nlink gives 2 for the one directory and 3 for the other

Since I thought it might be the server I am working I asked someone else. But he had exactly the same problem...
 [2009-03-14 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 Dec 21 15:01:29 2024 UTC