Skip to main content
Filter by
Sorted by
Tagged with
709 votes
10 answers
542k views

Why does printf not flush after the call unless a newline is in the format string? Is this POSIX behavior? How might I have printf immediately flush every time?
Crazy Chenz's user avatar
  • 13.3k
123 votes
20 answers
543k views

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("...
ipkiss's user avatar
  • 13.7k
81 votes
21 answers
167k views

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 ...
cusspvz's user avatar
  • 5,321
190 votes
4 answers
86k views

One of the things that get me thoroughly confused is the use of session.Flush,in conjunction with session.Commit, and session.Close. Sometimes session.Close works, e.g., it commits all the changes ...
Jon Limjap's user avatar
  • 95.7k
66 votes
2 answers
78k views

I have code such as the following: std::cout << "Beginning computations..."; // output 1 computations(); std::cout << " done!\n"; // output 2 The problem, however, is ...
synaptik's user avatar
  • 9,609
36 votes
5 answers
30k views

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 ...
Simplicity's user avatar
  • 49.4k
24 votes
7 answers
21k views

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 ...
Stefan Schultze's user avatar
18 votes
14 answers
52k views

<?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....
Speedy Wap's user avatar
104 votes
5 answers
266k views

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 "...
kojow7's user avatar
  • 11.6k
17 votes
3 answers
8k views

I understand that questions like, difference between endl and \n have been answered many times on SO. But they only mention that endl is able to flush the buffer onto the stdout, while \n, does not. ...
CaptainDaVinci's user avatar
32 votes
9 answers
46k views

I have a question in my mind that, while writing into the file, before closing is done, should we include flush()??. If so what it will do exactly? dont streams auto flush?? EDIT: So flush what it ...
i2ijeya's user avatar
  • 16.5k
22 votes
4 answers
28k views

Using PHP, I would like to make a while loop that reads a large file and sends the current line number when requested. Using Ajax, I'd like to get the current line count and print it out onto a page. ...
user avatar
4 votes
4 answers
4k views

Well I been doing a lot of searching on google and on here about how to flush the input stream properly. All I hear is mixed arguments about how fflush() is undefined for the input stream, and some ...
Programming_n00b's user avatar
27 votes
4 answers
19k views

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 ...
Adam Halasz's user avatar
  • 58.5k
18 votes
2 answers
13k views

Can someone explain the concept of buffers a bit more explicitly? I understand that buffers are data structures where characters are stored, and the place where the data is to be read from. What is ...
beeks's user avatar
  • 197
8 votes
7 answers
55k views

I have a problem with Eclipse IDE for C/C++ Developers. I'm writting a smal tool for converting Strings. While testing on some point eclipse stopped to give console output. e.g.: cout<<"...
Beasly's user avatar
  • 1,537
46 votes
3 answers
27k views

I'm writing a simple web app in Go and I want my responses to be streamed to the client (i.e. not buffered and sent in blocks once the request is fully processed) : func handle(res http....
rmonjo's user avatar
  • 2,735
12 votes
3 answers
12k views

I recently switched OS and am using a newer Python (2.7). On my old system, I used to be able to print instantaneously. For instance, suppose I had a computationally intense for loop: for i in range(...
Rishi's user avatar
  • 3,586
12 votes
2 answers
23k views

I was writing a simple program on Python 3.1 and I stumbled upon this: If I run this on the IDLE it works as intended - prints "Initializing." and then adds two dots, one after each second, and waits ...
roddds's user avatar
  • 133
6 votes
5 answers
20k views

After Mark Lakata pointed out that the garbage isn't properly defined in my question I came up with this. I'll keep this updated to avoid confusions. I am trying to get a function that I can call ...
Aseem Bansal's user avatar
  • 7,020
13 votes
5 answers
50k views

I am writing a C program in which I need to flush my memory. I would like know if there is any UNIX system command to flush the CPU cache. This is a requirement for my project which involves ...
Rose BEck's user avatar
  • 195
3 votes
1 answer
2k views

I have read this about the switch between read and write operations(and vice-versa) for files opened for update using fopen() (LINK) "For files open for update (those which include a "+" sign), on ...
Thokchom's user avatar
  • 1,652
1 vote
3 answers
6k views

I have written a daemon that writes a value in a file. What I have observed is that when I keep writing on a file, there is nothing visible in the file. in other hand, If I use fflush() method then ...
dexterous's user avatar
  • 6,614
53 votes
2 answers
18k views

I am not sure whether I need to call Flush() on the used objects if I write something like this: using (FileStream...) using (CryptoStream...) using (BinaryWriter...) { // do something } Are they ...
Ben's user avatar
  • 2,485
24 votes
3 answers
84k views

This is what my function looks like to open the serial port (using Ubuntu 12.04): int open_port(void) { int fd; /* File descriptor for the port */ fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | ...
capcom's user avatar
  • 3,337

1
2 3 4 5