1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This little program attempts to flush the system cache for some files.
6 // It's useful for testing Chrome with a cold database.
8 #include "base/files/file_path.h"
9 #include "base/process/memory.h"
10 #include "base/test/test_file_util.h"
12 int main(int argc, const char* argv[]) {
13 base::EnableTerminationOnHeapCorruption();
15 fprintf(stderr, "flushes disk cache for files\n");
16 fprintf(stderr, "usage: %s <filenames>\n", argv[0]);
20 for (int i = 1; i < argc; ++i) {
21 base::FilePath path = base::FilePath::FromUTF8Unsafe(argv[i]);
22 if (!file_util::EvictFileFromSystemCache(path)) {
23 fprintf(stderr, "Failed to evict %s from cache -- is it a directory?\n",