Bug #54709 [Com]: is_writable returns false for a directory but php can create files inside it

From: Date: Fri, 07 Mar 2014 20:51:00 +0000
Subject: Bug #54709 [Com]: 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-184611@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 Comment by: sam at rmcreative dot ru Reported by: schwarzenneger at hotmail dot com Summary: is_writable returns false for a directory but php can create files inside it Status: Open 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#184611) next »