File Read Cache - How to purge?

Hrvoje Niksic hniksic at xemacs.org
Tue Aug 21 09:34:41 EDT 2007


Signal <mugi at pinesalad.net> writes:

> 2. Is there anyway to somehow to take advantage of this "caching" by
> initializing it without reading through the entire file first?
>
> 3. If the answer to #2 is No, then is there a way to purge this
> "cache" in order to get a more accurate result in my routine?  That
> is without having to read another large file first?

On a Unix system the standard way to purge the cache is to unmount the
file system and remount it.  If you can't do that on Windows, you can
get the same effect by placing the test files on an external (USB)
hard drive; unplugging the drive and plugging it back again will
almost certainly force the OS to flush any associated caches.  Having
to do that is annoying, even as a last resort, but still better than
nothing.



More information about the Python-list mailing list