|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-03-30 21:44 UTC] fa@php.net
-Status: Open
+Status: Wont fix
[2010-03-30 21:44 UTC] fa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 14:00:02 2025 UTC |
Description: ------------ If i want to check if the file is writeable even if it not exists, if have to write an complicated function. if the behavior would change both cases, file exists and file does not exists would be handled in 1 line of code. This is not a test script, should only show up the thing. // Acutal behavior: if (is_writeable('/tmp/NOT_EXISTING')) // returns false // Better behavior: if (is_writeable('/tmp/NOT_EXISTING')) // returns true // Actual workaround: if (is_writeable('/tmp/NOT_EXISTING') || (file_exists('/tmp/NOT_EXISTING') === false && is_writeable(pathinfo('/tmp/NOT_EXISTING', PATHINFO_DIRNAME))) // return true