|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-01-04 23:56 UTC] rasmus@php.net
[2013-01-04 23:56 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2013-01-05 23:40 UTC] awm086 at gmail dot com
[2013-01-06 00:09 UTC] rasmus@php.net
[2013-01-06 00:24 UTC] awm086 at gmail dot com
[2013-01-06 00:33 UTC] rasmus@php.net
[2013-01-07 23:48 UTC] awm086 at gmail dot com
[2013-01-08 00:22 UTC] rasmus@php.net
[2013-01-08 00:35 UTC] Awm086 at gmail dot com
[2013-01-08 00:53 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 13:00:02 2025 UTC |
Description: ------------ The function file_put_contents is not atomic. When the function fails a file should not be created. However, when the reason for failure is full directory, (full diskspace, 0 empty), the function return FALSE, but a file is still created in the directory with size 0. The function should either complete the job successfully or have no effects at all (atomic). Test script: --------------- $data = 'somedata'; $temp_name = '/tmp/myfile'; if (file_put_contents($temp_name, $data) === FALSE) { // the message print that the file could not be created. print 'The file could not be created.'; } // after this a file named myfile will exist in the directory. Expected result: ---------------- No file should be created Actual result: -------------- File is created in the directory.