Bug #54709 [Opn->Fbk]: is_writable returns false for a directory but php can create files inside it
| From: | cmb@php.net | Date: | Mon, 06 Jun 2016 19:51:09 +0000 |
| Subject: | Bug #54709 [Opn->Fbk]: is_writable returns false for a directory but php can create files inside it | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201492@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54709&edit=1
ID: 54709
Updated by: cmb@php.net
Reported by: schwarzenneger at hotmail dot com
Summary: is_writable returns false for a directory but php
can create files inside it
-Status: Open
+Status: Feedback
Type: Bug
Package: IIS related
Operating System: Windows XP SP3/IIS 5.1
PHP Version: 5.3SVN-2011-05-11 (snap)
Block user comment: N
Private report: N
New Comment:
> It seems to be fixed in 5.4.20.
@schwarzenneger: can you confirm?
Previous Comments:
------------------------------------------------------------------------
[2014-03-07 20:50:59] sam at rmcreative dot ru
It seems to be fixed in 5.4.20.
------------------------------------------------------------------------
[2011-05-11 12:40:55] schwarzenneger at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.is-writable
---
Quote: Returns TRUE if the filename exists and is writable. The filename argument may be a directory
name allowing you to check if a directory is writable.
Well it did not return true in the following test case. The file system is NTFS.
Test script:
---------------
var_dump(is_writeable("C:\\Inetpub\\wwwroot\\simplepiecache")); // false
var_dump(is_writeable("\\Inetpub\\wwwroot\\simplepiecache")); // false
var_dump(is_writeable("/Inetpub/wwwroot/simplepiecache")); // false
var_dump(is_writeable("/Inetpub/wwwroot/simplepiecache/")); // false
file_put_contents("/Inetpub/wwwroot/mln/simplepiecache/aaa.txt", "bbb"); // DOES
create a file aaa.txt containing bbb
echo file_get_contents("/Inetpub/wwwroot/mln/simplepiecache/aaa.txt"); // bbb
Expected result:
----------------
var_dump(is_writeable("C:\\Inetpub\\wwwroot\\simplepiecache")); // should be true
var_dump(is_writeable("\\Inetpub\\wwwroot\\simplepiecache")); // should be true
var_dump(is_writeable("/Inetpub/wwwroot/simplepiecache")); // should be true
var_dump(is_writeable("/Inetpub/wwwroot/simplepiecache/")); // should be true
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54709&edit=1