#include #include #include #include int main() { int filehandle; char filename[20]; char countername[20]; int count; FILE *fp; printf("Please enter the name of the file you wish to create\n"); printf("in the format myfile.php : \n"); gets(filename); printf("Now enter a name for the counter file.\n"); gets(countername); printf("Please enter the starting count.\n"); scanf("%d",&count); /*create counterfile with the starting count*/ filehandle = creat(countername,S_IREAD|S_IWRITE); if(fp = fopen(countername,"a")) { fprintf(fp,"%d",count); fclose(fp); } else printf("cannot open %s ",countername); /*create php file*/ filehandle = creat(filename,S_IREAD|S_IWRITE); /*create counter in php file*/ if(fp = fopen(filename,"w+")) { fprintf(fp,"\n"); fclose(fp); } else printf("cannot create %s",filename); return 0; }