Back to index

glibc  2.9
temptest.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <string.h>
00004 
00005 char *files[500];
00006 
00007 int
00008 main (int argc, char *argv[])
00009 {
00010   FILE *fp;
00011   int i;
00012 
00013   for (i = 0; i < 500; i++) {
00014     files[i] = tempnam (NULL, "file");
00015     if (files[i] == NULL) {
00016       printf ("tempnam failed\n");
00017       exit (1);
00018     }
00019     printf ("file: %s\n", files[i]);
00020     fp = fopen (files[i], "w");
00021     fclose (fp);
00022   }
00023 
00024   for (i = 0; i < 500; i++)
00025     remove (files[i]);
00026 
00027   return 0;
00028 }