Bug #77187 [Com]: mkdir() fails to create dir after using some func-s on the parent dir
| From: | a at b dot c dot de | Date: | Fri, 23 Nov 2018 10:39:03 +0000 |
| Subject: | Bug #77187 [Com]: mkdir() fails to create dir after using some func-s on the parent dir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218101@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77187&edit=1
ID: 77187
Comment by: a at b dot c dot de
Reported by: batonxleba at gmail dot com
Summary: mkdir() fails to create dir after using some func-s
on the parent dir
Status: Open
Type: Bug
Package: Directory function related
Operating System: gentoo
PHP Version: 7.2.12
Block user comment: N
Private report: N
New Comment:
Other observations from a Win10 build consistent with the above:
1) clearstatcache() doesn't affect behaviour
2) Being Windows, using "del" instead of an "rm" port doesn't fix things.
3) a single mkdir('vpupkin/'.date("d.m.Y"), 0700, true) call fails in the same
way as the two consecutive mkdirs() (vpupkin is created but can't be found to create the
subdirectory within it).
4) using unlink() instead of exec('rm') does allow the subdirectory to be created.
Previous Comments:
------------------------------------------------------------------------
[2018-11-22 23:37:53] batonxleba at gmail dot com
Description:
------------
mkdir () does not create a subdirectory and generates an error when I try to create it in a
directory that has the same name as the file that was deleted before this but any of the is_dir /
file_exists / is_writable functions were applied to it.
if i comment line 5 in example below script will work fine.
my cli php
PHP 7.2.10 (cli) (built: Nov 10 2018 11:44:18) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies
Test script:
---------------
#!/usr/bin/php
<?php
exec('> vpupkin');
if(is_dir('vpupkin'))print 'true'."\n";
exec('rm -f vpupkin');
mkdir('vpupkin',0700);
mkdir('vpupkin/'.date("d.m.Y"),0700);
?>
Actual result:
--------------
dev ~/testftp # rm -r vpupkin; ./t.php
PHP Warning: mkdir(): No such file or directory in /root/testftp/t.php on line 9
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77187&edit=1