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

From: Date: Tue, 25 May 2021 10:06:32 +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-234011@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: kuragayalasudheer1 at gmail dot com Reported by: schwarzenneger at hotmail dot com Summary: is_writable returns false for a directory but php can create files inside it Status: No Feedback Type: Bug Package: IIS related Operating System: Windows XP SP3/IIS 5.1 PHP Version: 5.3SVN-2011-05-11 (snap) Assigned To: cmb Block user comment: N Private report: N New Comment: great share https://thebasicanswers.com/ https://vocal.media/geeks/live-watch-cartoon-online-2021-watch-cartoons-online-and-its-alternatives https://www.djoffice.in/p/telugu-dj-songs.html https://digitalsudheer.com/ Previous Comments: ------------------------------------------------------------------------ [2016-06-06 19:51:08] cmb@php.net > It seems to be fixed in 5.4.20. @schwarzenneger: can you confirm? ------------------------------------------------------------------------ [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

« previous php.bugs (#234011) next »