Questions tagged [flush]

Flush means clearing all the buffers for a stream. This will cause any buffered data to be written to the underlying device.

Flush means clearing all the buffers for a stream. This will cause any buffered data to be written to the underlying device.

1132 questions
12
votes
2 answers

Python3 sleep() problem

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 for input. from time import sleep def…
roddds
  • 133
  • 1
  • 2
  • 6
12
votes
1 answer

Force Node.js to flush writes to child processes

I spawn a child process like this: var child = require('child_process'); var proc = child.spawn('python', ['my_script.py', '-p', 'example']); I also set some data…
kaoD
  • 1,534
  • 14
  • 25
12
votes
3 answers

How to make sure that a file was permanently saved on USB, when user doesn't use "Safely Remove Hardware"?

When I save a file on a USB within my delphi application, how can I make sure the file is really (permanently) saved on the USB, when "Safely Remove Hardware" is not performed (especially forgotten to use)? Telling our customer to use the windows…
markus_ja
  • 2,931
  • 2
  • 28
  • 36
12
votes
4 answers

How to flush the CPU cache in Linux from a C program?

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 calculating the time taken for my logic. I have read about…
Rose BEck
  • 185
  • 1
  • 1
  • 10
11
votes
1 answer

What does flushing the database mean? Also with "flash"

I want to know what "flush" and "flash" means and the difference between them.
user5150273
  • 195
  • 1
  • 2
  • 8
11
votes
1 answer

flush stdout inside numba jitted function

Apparently numba supports neither sys.stdout.flush nor print("", flush=True). What is a good way to flush "prints" inside a jitted function?
nivniv
  • 3,421
  • 5
  • 33
  • 40
11
votes
5 answers

Is there a way to flush the DNS cache from a C# WPF app? (on XP, Vista, Win7)

Is there a way to flush the DNS cache from a C# WPF app? The application would be running on either XP, Vista, or Windows 7.
Greg
  • 34,042
  • 79
  • 253
  • 454
11
votes
2 answers

Delete all index data/files in disk using Apache Lucene?

How can I flush/delete/erase all the index files/data in the disk using Apache Lucene.This is my code so far and still I can't remove index files.Please help me out... Test: public class Test { private static final String INDEX_DIR =…
Amila Iddamalgoda
  • 4,166
  • 11
  • 46
  • 85
11
votes
3 answers

What does std::ofstream::close() actually do?

This question: How to protect log from application crash? has lead me to another - what does std::ofstream::close() actually do? I know it calls flush() and that's one thing. But what else? What closing the file actually is? Edit: Let me rephrase my…
NPS
  • 6,003
  • 11
  • 53
  • 90
11
votes
4 answers

How do I flush output to file after each write with a Fortran program?

I am running a loop in a Fortran program compiled with gfortran that outputs numerical values to an output file for each iteration of the loop. The problem is that the output is not saved to the file but every so many steps. How do I get it to…
phoganuci
  • 4,984
  • 9
  • 39
  • 50
11
votes
1 answer

I created a PrintWriter with autoflush on; why isn't it autoflushing?

My client is a web browser, and sending request to myserver using this url: http://localhost This is the server side code. The problem lies in the run method of the ServingThread class. class ServingThread implements Runnable{ private Socket…
mogli
  • 1,549
  • 4
  • 29
  • 57
10
votes
2 answers

Is it necessary to call a flush() (JPA interface) in this situation?

Because calling a flush() to get every entities persist from memory to database. So if I use call too much unnecessary flush(), it could take much time therefore not a good choice for the performance. Here is a scenario that I don't know when to…
Kewei Shang
  • 949
  • 3
  • 11
  • 27
10
votes
3 answers

Flushing Perl STDIN buffer

Is there any way to clear the STDIN buffer in Perl? A part of my program has lengthy output (enough time for someone to enter a few characters) and after that output I ask for input, but if characters were entered during the output, they are "tacked…
mcwillig
  • 213
  • 3
  • 9
10
votes
6 answers

How do I flush a 'RandomAccessFile' (java)?

I'm using RandomAccessFile in java: file = new RandomAccessFile(filename, "rw"); ... file.writeBytes(...); How can I ensure that this data is flushed to the Operating System? There is no file.flush() method. (Note that I don't actually expect it…
Tim Cooper
  • 10,023
  • 5
  • 61
  • 77
10
votes
3 answers

Why do we have to manually flush() the EntityManager in a extended PersistenceContext?

In our J2EE application, we use a EJB-3 stateful bean to allow the front code to create, modify and save persistent entities (managed through JPA-2). It looks something like…
Xavier Portebois
  • 3,354
  • 6
  • 33
  • 53