home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 387b.lha / dice_v2.02 / lib / stdio / tmpfile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-30  |  327 b   |  25 lines

  1.  
  2. /*
  3.  *  tmpfile()       - create a temporary file that is deleted on
  4.  *              close
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10.  
  11. FILE *
  12. tmpfile()
  13. {
  14.     char *name;
  15.     FILE *fi;
  16.  
  17.     if (name = strdup(tmpnam(NULL))) {
  18.     if (fi = fopen(name, "wb+C"))
  19.         return(fi);
  20.     free(name);
  21.     }
  22.     return(NULL);
  23. }
  24.  
  25.