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
24
votes
11 answers

How do I flush a file in Perl?

I have Perl script which appends a new line to the existing file every 3 seconds. Also, there is a C++ application which reads from that file. The problem is that the application begins to read the file after the script is done and file handle is…
Mihran Hovsepyan
  • 10,810
  • 14
  • 61
  • 111
23
votes
7 answers

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 physically written to disk. Is there a .NET or…
Stefan Schultze
  • 9,240
  • 6
  • 35
  • 42
23
votes
4 answers

PHP Flush: How Often and Best Practices

I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after the top portion of my page loads (head, css, top banner/search/nav). Is there any performance hit in flushing? Is…
Cory Dee
  • 2,858
  • 6
  • 40
  • 55
23
votes
3 answers

Clearing the serial port's buffer

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 | O_NDELAY); if (fd == -1) { // Could not…
capcom
  • 3,257
  • 12
  • 40
  • 50
22
votes
4 answers

PHP - Flushing While Loop Data with Ajax

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. Using html buttons, I'd like to be able to click…
user1191027
22
votes
8 answers

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/30 [00:02<00:00, 11.49it/s]Pickling... 100%|██████████|…
Dims
  • 47,675
  • 117
  • 331
  • 600
20
votes
4 answers

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?
user1243746
20
votes
6 answers

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, it returns nothing. I can get it working…
Xavi
  • 1,555
  • 2
  • 13
  • 15
19
votes
5 answers

When Hibernate flushes a Session, how does it decide which objects in the session are dirty?

My understanding of Hibernate is that as objects are loaded from the DB they are added to the Session. At various points, depending on your configuration, the session is flushed. At this point, modified objects are written to the database. How does…
tgdavies
  • 10,307
  • 4
  • 35
  • 40
19
votes
1 answer

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 when the application is shut down (even weeks after…
Robert Cutajar
  • 3,181
  • 1
  • 30
  • 42
19
votes
3 answers

Logback file appender doesn't flush immediately

For some circumstances I need to force flushing in logback's file appender immediately. I've found in docs this option is enabled by default. Mysteriously this doesn't work. As I see in the sources underlying process involves BufferedOutputSream…
Viktor Stolbin
  • 2,899
  • 4
  • 32
  • 53
18
votes
2 answers

C++ cout and cin buffers, and buffers in general

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 the idea of flushing buffers? When a buffer is…
beeks
  • 197
  • 1
  • 1
  • 5
18
votes
4 answers

How to flush a TFileStream?

TFileStream provides buffered output, which is great in most cases, but in some cases (especially during debugging) it's nice to flush the buffer immediately. Thing is, I don't know of any way to do that except calling Free, which is kind of…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
18
votes
6 answers

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 done this, but I can't find it in the standard…
Thomas Padron-McCarthy
  • 27,232
  • 8
  • 51
  • 75
17
votes
13 answers

php flush not working

'; ob_flush(); flush(); usleep(300000); } ?> Url that contains the code: http://domainsoutlook.com/sandbox/delayed.php I have a dedicated server so I can make the changes. I am…
Speedy Wap
  • 478
  • 4
  • 7
  • 18
1 2
3
75 76