#30531 [Opn->Fbk]: file_put_contents
| From: | tony2001@php.net | Date: | Fri, 22 Oct 2004 12:37:32 +0000 |
| Subject: | #30531 [Opn->Fbk]: file_put_contents | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67955@lists.php.net to get a copy of this message | ||
ID: 30531
Updated by: tony2001@php.net
Reported By: teunkloosterman at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 5.0.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Works fine here.
Previous Comments:
------------------------------------------------------------------------
[2004-10-22 14:32:23] teunkloosterman at gmail dot com
Description:
------------
The file_put_contents function doesn't return anything on an error, it
would be better if for example: on a permission error, I could catch an
error instead of a big message and no result
Reproduce code:
---------------
if(file_put_contents("./file", " ") === FALSE)
{
exit("error, could not write to file");
}
else
{
echo "Yay, file is completed";
}
Expected result:
----------------
error, could not write to file
Actual result:
--------------
Warning: file_put_contents(./file) [function.file-put-contents]: failed
to open stream: Permission denied in /var//www/test.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30531&edit=1