1,135 questions
1636
votes
14
answers
1.2m
views
How can I flush the output of the print function?
How do I force Python's print function to flush the buffered output to the screen?
See also: Disable output buffering if the goal is to change the buffering behaviour generally. This question is ...
298
votes
5
answers
306k
views
How often does python flush to a file?
How often does Python flush to a file?
How often does Python flush to stdout?
I'm unsure about (1).
As for (2), I believe Python flushes to stdout after every new line. But, if you overload stdout ...
161
votes
7
answers
319k
views
What is the purpose of flush() in Java streams?
In Java, flush() method is used in streams. But I don't understand what are all the purpose of using this method?
fin.flush();
tell me some suggestions.
123
votes
20
answers
543k
views
How can I clear an input buffer in C?
I have the following program:
int main(int argc, char *argv[])
{
char ch1, ch2;
printf("Input the first character:"); // Line 1
scanf("%c", &ch1);
printf("...
104
votes
5
answers
266k
views
MySQL: When is Flush Privileges in MySQL really needed?
When creating new tables and a user to go along with it, I usually just invoke the following commands:
CREATE DATABASE mydb;
GRANT ALL PRIVILEGES ON mydb.* TO myuser@localhost IDENTIFIED BY "...
81
votes
21
answers
167k
views
How to flush output after each `echo` call?
I have a php script that only produces logs to the client.
When I echo something, I want it to be transferred to client on-the-fly.
(Because while the script is processing, the page is blank)
I had ...
66
votes
2
answers
78k
views
c++ force std::cout flush (print to screen)
I have code such as the following:
std::cout << "Beginning computations..."; // output 1
computations();
std::cout << " done!\n"; // output 2
The problem, however, is ...
60
votes
3
answers
29k
views
Is there a way to programmably flush the buffer in log4net
I'm using log4net with AdoNetAppender. It's seems that the AdoNetAppender has a Flush method. Is there anyway I can call that from my code?
I'm trying to create an admin page to view all the entries ...
48
votes
5
answers
23k
views
does close() imply flush() in Python?
In Python, and in general - does a close() operation on a file object imply a flush() operation?
40
votes
7
answers
38k
views
How can I flush the output of disp in Matlab or Octave?
I have a program in Octave that has a loop - running a function with various parameters, not something that I can turn into matrices. At the beginning of each iteration I print the current parameters ...
36
votes
5
answers
30k
views
endl and flushing the buffer
In the C++ primer book, in chapter (1), it mentions the following:
endl is a special value, called a manipulator, that when written to an
output stream has the effect of writing a newline to the ...
31
votes
9
answers
30k
views
PHP Flush that works... even in Nginx
Is it possible to echo each time the loop is executed? For example:
foreach(range(1,9) as $n){
echo $n."\n";
sleep(1);
}
Instead of printing everything when the loop is finished, I'd like to ...
30
votes
7
answers
33k
views
Close a filestream without Flush()
Can I close a file stream without calling Flush (in C#)? I understood that Close and Dispose calls the Flush method first.
30
votes
10
answers
43k
views
How to "flush" tqdm progress bar explicitly?
I often see, that tqdm progress bar is broken by other print, like:
93%|█████████▎| 28/30 [00:02<00:00, 13.44it/s]Subject S9
100%|██████████| 30/30 [00:02<00:00, 12.94it/s]
93%|█████████▎| 28/...
27
votes
4
answers
19k
views
How can I output data before I end the response?
Here is my snippet I tested it in Chrome 11, and Firefox 4:
var http = require('http');
http.createServer(function(request, response){
// Write Headers
response.writeHead(200);
// Write ...
26
votes
7
answers
51k
views
stdout and need to flush it C++
I have some C++ code that uses cout statements for debug purposes and for some reason I can't get all the data to print unless I do a std::cout.flush(); at the end.
I don't quite understand why this ...
25
votes
2
answers
40k
views
Django flush vs sqlclear & syncdb
Can anyone tell if there is a difference between
>manage.py flush # or reset
and
>manage.py sqlclear appname | python manage.py dbshell
>manage.py syncdb
24
votes
7
answers
21k
views
How to ensure all data has been physically written to disk?
I understand that .NET FileStream's Flush method only writes the current buffer to disk, but dependent on Windows' disk driver and the hard disk firmware this is no guarantee that the data is actually ...
22
votes
5
answers
33k
views
Doctrine2 - Get entity ID before flush
Is there any way to get an entity ID before the persist/flush?
I mean:
$entity = new PointData();
$form = $this->createForm(new PointDataType(), $entity);
If I try $entity->getId() at this point,...
20
votes
4
answers
35k
views
When to flush a file in Go?
When is it necessary to flush a file?
I never do it because I call File.Close and I think that it is flushed automatically, isn't it?
20
votes
6
answers
6k
views
Does reading from stdin flush stdout?
stdout is line-buffered when connected to a terminal, but I remember reading somewhere that reading (at least from stdin) will automatically flush stdout. All C implementations that I have used have ...
19
votes
1
answer
30k
views
Log4Net RollingFileAppender not flushing IO buffer with low volume log
I'm pondering on the same issue as HENRI COOK did. It's been reported as a bug on Apache Jira as far as we can tell from the short description.
My problem in essence is that events are only logged ...
18
votes
14
answers
52k
views
php flush not working
<?php
for($i=0;$i<20;$i++)
{
echo 'printing...<br />';
ob_flush();
flush();
usleep(300000);
}
?>
Url that contains the code: http://domainsoutlook.com/sandbox/delayed....
17
votes
3
answers
5k
views
Is there a guarantee of stdout auto-flush before exit? How does it work?
Here is the code (valid C and C++)
#include <stdio.h>
int main() {
printf("asfd");
// LINE 1
return 0;
}
If in line 1 I put segfaulting expression the program would just crash ...
16
votes
2
answers
5k
views
Reading output from child process using python
The Context
I am using the subprocess module to start a process from python. I want to be able to access the output (stdout, stderr) as soon as it is written/buffered.
The solution must support ...