aboutsummaryrefslogtreecommitdiffstats
path: root/makedata.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2011-02-01 13:07:03 -0600
committerPeter Seebach <peter.seebach@windriver.com>2011-02-01 13:07:03 -0600
commita4cf5f2f5bac9aeb1d9aac73140411b7eb69ee00 (patch)
treef56481e95749241afa9604a3540cbe0cede84170 /makedata.c
parentd1d46ce88db792883ce9b1be00e2b5adeaf225bd (diff)
downloadpseudo-a4cf5f2f5bac9aeb1d9aac73140411b7eb69ee00.tar.gz
pseudo-a4cf5f2f5bac9aeb1d9aac73140411b7eb69ee00.tar.bz2
pseudo-a4cf5f2f5bac9aeb1d9aac73140411b7eb69ee00.zip
Add performance test (rough draft).
Diffstat (limited to 'makedata.c')
-rw-r--r--makedata.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/makedata.c b/makedata.c
new file mode 100644
index 0000000..a3f9a86
--- /dev/null
+++ b/makedata.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main(void) {
+ int i, j, k, l;
+ /* templateish form used so it's obvious that it's long enough */
+ char name[] = "dir_%d/dir_%d/%d%d.txt";
+ for (i = 0; i < 10; ++i) {
+ snprintf(name, sizeof(name), "dir_%d", i);
+ mkdir(name);
+ for (j = 0; j < 40; ++j) {
+ snprintf(name, sizeof(name), "dir_%d/dir_%d", i, j);
+ mkdir(name);
+ for (k = 0; k < 10; ++k) {
+ for (l = 0; l < 10; ++l) {
+ FILE *fp;
+ snprintf(name, sizeof(name),
+ "dir_%d/dir_%d/%d%d.txt",
+ i, j, k, l);
+ fp = fopen(name, "w");
+ if (fp) {
+ fprintf(fp, "dummy file.\n");
+ fclose(fp);
+ }
+ }
+ }
+ }
+ }
+ return 0;
+}