flush

Flush disk write cache from Windows CLI

Does anyone know how to flush the disk write cache data from the cache manager for the current directory (or any given file or directory, for that matter), from a Windows command line? ...

How to empty/flush Windows READ disk cache in C#?

If I am trying to determine the read speed of a drive, I can code a routine to write files to a filesystem and then read those files back. Unfortunately, this doesn't give an accurate read speed because Windows does disk read caching. Is there a way to flush the disk read cache of a drive in C# / .Net (or perhaps with Win32 API calls) ...

How to discard incoming packets in raw socket?

I'm writing a C/C++ application under Linux that reads data from a raw socket (for ICMP packets). Question: is there a way to discard all data that is still queued on the socket? The problem is that after sleeping for a while, there is data queued up on the socket which I'm not interested in; so it would be best to just tell the socket ...

How to flush output of Python print?

I would like to force Python's print function to output to the screen. ...

sleep() is stalling my program too early. What am I doing wrong?

I want to write a small program that should print something like testing CPU... done testing RAM... done and so on. I wrote the following program in C: printf( "testing RAM...\t\t" ); sleep( sleep_time ); printf( "done\n\n" ); printf( "testing HDD...\t\t" ); sleep( sleep_time ); printf( "done\n\n" ); where sleep_time i...

PHP Flush: How Often and Best Practises

I just finished reading this post: http://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 there such a thing as doing it too often? What are the best practices? If I am going to h...

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 Win32 method that can give me this guarantee? So if there is power loss one nanosecond aft...

Flushing JDBC connection pools

Does anyone know the best (or any) way to flush a JDBC connection pool? I can't find anything obvious in the documentation. It appears connection pools aren't meant to ever be deleted. My current thought is to delete all DataSources from the hash we store them in, which will trigger our code to make new ones. However, my first attemp...

SQL Server Log File Confusion

Hey all I'm looking for some clarity on the SQL Server log file. I have a largish database (2GB) which lately wasn't backed up for whatever reason. The log file for the database grew to around 11GB which from my understanding is all the transactions and statements that occurred in the database. My questions: What causes the database...

Hibernate flush doesn't update database

I'm using hibernate to store a set of objects from a web service. As the object are received each I am saving them using hibernate. Receiving the objects is wrapped in a transaction and all the objects appear in the database after the final object is received. I am now trying have each object appear in the database when saved. I've ...

When do i need to flush Rhino Commons UnitOfWork?

When using Rhino Commons UnitOfWork (in a UnitOfWorkApplication for ASP-MVC), I like to use the Rhino Repository static class to save entities like this: Repository<Car>.Save(new Car(Id = 1)); I find that I can then get the entity out immediately after that call using: Car car = Repository<Car>.Get(1); This works fine. However, whe...

Rhino UnitOfWorkApplication + Castle Automatic Transaction Management application does not flush automatically on request end

I'm building ASP.Net MVC aplication based on UnitOfWorkApplication and I'd like to use Castle ATM facility. At the moment I've problem with flushing the session on request end. My service class (which is called in my controller action method) looks like this: [Transactional] public class UserAdminService : IUserAdminService { [Transac...

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 counterproductive. Is there a better way to do it? ...

How to flush HttpListener response stream?

HttpListener gives you response stream, but calling flush means nothing (and from sources it's clear, because it's actually doing nothing). Digging inside HTTP API shows that this is a limitation of HttpListener itself. Anyone knows exactly how to flush response stream of HttpListener (may be with reflection or additional P/Invokes)? U...

peek at input buffer, and flush extra characters in C

If I want to receive a one character input in C, how would I check to see if extra characters were sent, and if so, how would I clear that? Is there a function which acts like getc(stdin), but which doesn't prompt the user to enter a character, so I can just put while(getc(stdin)!=EOF);? Or a function to peek at the next character in th...

JPA NamedQuery does not pick up changes to modified Entity

I have a method that retrieves Entities using a NamedQuery. I update a value of each entity and then run another named query (in the same method and Transaction) filtering by the old value and it returns the same Entities as if I had not changed them. I understand that the EntityManager needs to be flushed and also that it should happen...

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

Hey fellows, 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 call a flush()? //Order and Item have Bidirectional Relationships Order ord = ...

how to make echo print out right away in PHP?

By default it will not print out anything until the whole page has finished executing. Is there any function that can make it flush out right away? But not by calling ob_end_flush() multiple times,which is not what I want. Hope you guys got me? ...

C# or .NET Flushing Keyboard Buffer

How do I flush the keyboard buffer in C# using Windows Forms? I have a barcode scanner which acts like a keyboard. If a really long barcode is scanned and the cancel button is hit on the form, I need the keyboard buffer to be cleared. So I need to flush and ignore all pending input. I need the buffer cleared because if the barcode conta...

Do I need to do StreamWriter.flush() ?

suppose this code (C#): using (MemoryStream stream = new MemoryStream()) { StreamWriter normalWriter = new StreamWriter(stream); BinaryWriter binaryWriter = new BinaryWriter(stream); foreach(...) { binaryWriter.Write(number); normalWriter.WriteLine(name); //<~~ easier to reader afterward. } retu...