-s show statistics summary
-z zero statistics
-c run a cache cleanup
+-C clear the cache completely
-F <maxfiles> set maximum files in cache
-M <maxsize> set maximum size of cache (use G, M or K)
-h this help page
if you manually modify the cache contents or believe that the cache
size statistics may be inaccurate\&.
.IP
+.IP "\fB-C\fP"
+Clear the entire cache, removing all cached files\&.
+.IP
.IP "\fB-F maxfiles\fP"
This sets the maximum number of files allowed in
the cache\&. The value is stored inside the cache directory and applies
stat(tmp_hashname, &st2) != 0 ||
rename(tmp_hashname, hashname) != 0 ||
rename(tmp_stderr, path_stderr) != 0) {
- cc_log("failed to rename tmp files\n");
+ cc_log("failed to rename tmp files - %s\n", strerror(errno));
stats_update(STATS_ERROR);
failed();
}
printf("-s show statistics summary\n");
printf("-z zero statistics\n");
printf("-c run a cache cleanup\n");
+ printf("-C clear the cache completely\n");
printf("-F <maxfiles> set maximum files in cache\n");
printf("-M <maxsize> set maximum size of cache (use G, M or K)\n");
printf("-h this help page\n");
int c;
size_t v;
- while ((c = getopt(argc, argv, "hszcF:M:V")) != -1) {
+ while ((c = getopt(argc, argv, "hszcCF:M:V")) != -1) {
switch (c) {
case 'V':
printf("ccache version %s\n", CCACHE_VERSION);
printf("Cleaned cached\n");
break;
+ case 'C':
+ wipe_all(cache_dir);
+ printf("Cleared cache\n");
+ break;
+
case 'z':
stats_zero();
printf("Statistics cleared\n");
void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize);
void cleanup_all(const char *dir);
+void wipe_all(const char *dir);
int execute(char **argv,
const char *path_stdout,
-s show statistics summary
-z zero statistics
-c run a cache cleanup
+-C clear the cache completely
-F <maxfiles> set maximum files in cache
-M <maxsize> set maximum size of cache (use G, M or K)
-h this help page
if you manually modify the cache contents or believe that the cache
size statistics may be inaccurate.
+dit(bf(-C)) Clear the entire cache, removing all cached files.
+
dit(bf(-F maxfiles)) This sets the maximum number of files allowed in
the cache. The value is stored inside the cache directory and applies
to all future compiles. Due to the way the value is stored the actual
free(sfile);
}
}
+
+
+/* traverse function for wiping files */
+static void wipe_fn(const char *fname, struct stat *st)
+{
+ char *p;
+
+ if (!S_ISREG(st->st_mode)) return;
+
+ p = basename(fname);
+ if (strcmp(p, "stats") == 0) {
+ free(p);
+ return;
+ }
+ free(p);
+
+ unlink(fname);
+}
+
+
+/* wipe all cached files in all subdirs */
+void wipe_all(const char *dir)
+{
+ char *dname;
+ int i;
+
+ for (i=0;i<=0xF;i++) {
+ x_asprintf(&dname, "%s/%1x", dir, i);
+ traverse(dir, wipe_fn);
+ free(dname);
+ }
+
+ /* and fix the counters */
+ cleanup_all(dir);
+}
-s show statistics summary
-z zero statistics
-c run a cache cleanup
+-C clear the cache completely
-F <maxfiles> set maximum files in cache
-M <maxsize> set maximum size of cache (use G, M or K)
-h this help page
statistics up to date on each compile. This option is mostly useful
if you manually modify the cache contents or believe that the cache
size statistics may be inaccurate.
+<p><p></p><dt><strong><strong>-C</strong></strong><dd> Clear the entire cache, removing all cached files.
<p><p></p><dt><strong><strong>-F maxfiles</strong></strong><dd> This sets the maximum number of files allowed in
the cache. The value is stored inside the cache directory and applies
to all future compiles. Due to the way the value is stored the actual
rsync -Pavz samba.org::ftp/unpacked/ccache .
</pre>
+<h2>Related projects</h2>
+
+A bunch of related projects and patches have sprung up, particular
+related to building a distributed version of ccache.
+
+<ul>
+<li> <a href="http://distcc.samba.org/">distcc</a>
+<li>
+
<hr>
<tiny>
<a href="http://samba.org/~tridge/">Andrew Tridgell</a><br>