#include // mkdir #include // close #include // open, O_* #include // memcpy #include // PATH_MAX #include #include // drand48 #include #include // #include #include #include // debugging /* smallest and largest file sizes, in bytes */ struct randstate { unsigned short state[3]; }; const struct randstate seed = {{ 42, 9, 6 }}; const int smallest_file = 40000; const int largest_file = 80000; const double steepness = 128; const int number_of_subdirs = 29; const int max_files_per_dir = 40; double between(int ymin, int ymax, int xmin, int xmax, double x) { /* maps from xmin-xmax to ymin-ymax at x */ double effective_x = (((double)(x - xmin)) /(xmax-xmin)); /* 0-1 */ /* bias towards ymax for higher x like before 0.5 -> 0.5, but now 0.5 -> 0.9 and 0.9 to 0.99 */ double result = pow(steepness, effective_x) / steepness; return result * (ymax-ymin) + ymin; } int main(int argc, char *argv[]) { struct randstate base = seed; char path[PATH_MAX]; const char schars[] = "ashtgyneoiqdrwbjfupzxmcvkl"; char achar(void) { return schars[(int)(erand48(base.state) * (sizeof(schars)-1))]; } int addsuffix(int plen) { int suff; int top = erand48(base.state)*6 + 1; for(suff=0;suff