php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35914 Does fflush() readly works?
Submitted: 2006-01-06 04:04 UTC Modified: 2006-01-06 05:18 UTC
From: sqchen at citiz dot net Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.1.1 OS: redhat 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sqchen at citiz dot net
New email:
PHP Version: OS:

 

 [2006-01-06 04:04 UTC] sqchen at citiz dot net
Description:
------------
Do you this think fflush() realy works? plese see following code

if you answer it's not a bug, please give me a example how to use fflush() correctly.

Reproduce code:
---------------
----before fflush----
<?php
$fp = fopen("1.txt", "w");
while(1)
{
   fwrite($fp, "a");
   sleep(1);
}
?>
----after fflush----
<?php
$fp1 = fopen("1.txt", "w");
$fp2 = fopen("2.txt", "w");
while(1)
{
   fwrite($fp1, "a");
   fflush($fp2);
   sleep(1);
}
?>

Expected result:
----------------
---before fflush---
no contents in file "1.txt" until it's buffer is full
---after  fflush---
"a  a  a  a....." in file "2.txt" immediately

Actual result:
--------------
---before fflush---
"a  a  a  a....." in file "1.txt" immediately
---after fflush---
empty in file "2.txt"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-06 05:18 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 03:01:28 2024 UTC