#47579 [Com]: Deleting a directory created recursively with mkdir
| From: | yorianbenjamin at hotmail dot com | Date: | Sat, 07 Mar 2009 00:02:17 +0000 |
| Subject: | #47579 [Com]: Deleting a directory created recursively with mkdir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134471@lists.php.net to get a copy of this message | ||
ID: 47579
Comment by: yorianbenjamin at hotmail dot com
Reported By: yorianbenjamin at hotmail dot com
Status: Feedback
Bug Type: Directory function related
Operating System: Linux
PHP Version: 5.2.9
New Comment:
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...
Previous Comments:
------------------------------------------------------------------------
[2009-03-06 10:44:02] jani@php.net
Propably just a misconfigured system, but what exacty were the
permissions (for ALL directories created) ?
------------------------------------------------------------------------
[2009-03-05 20:23:45] 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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47579&edit=1