Blob


1 #include <stdio.h>
3 /* I need a big file made up of ascii characters. dd if=/dev/zero is
4 * thus not an option, truncate is not portable. This is some order
5 * of magnitude faster than the equivalent sh script */
7 int
8 main(int argc, char **argv)
9 {
10 FILE *out;
11 int i, j;
13 if (argc != 2) {
14 fprintf(stderr, "USAGE: %s <file>\n", *argv);
15 return 1;
16 }
18 if ((out = fopen(argv[1], "w")) == NULL) {
19 fprintf(stderr, "cannot open file: %s\n", argv[1]);
20 return 1;
21 }
23 for (i = 0; i < 1024; ++i)
24 for (j = 0; j < 1024; ++j)
25 fprintf(out, "a\n");
27 fclose(out);
28 return 0;
29 }