home *** CD-ROM | disk | FTP | other *** search
- char *tempnam(dir,prefix)
- char *dir, *prefix;
- {
- char *s, *q, *ctime();
- long tloc,time();
- s = (char *)malloc(strlen(dir)+strlen(prefix)+13);
- *s = '\0';
- time(&tloc);
- q = ctime(&tloc);
- strcat(s,dir);
- strcat(s,"/");
- strcat(s,prefix);
- q += 4;
- strncat(s,q,3); q += 4;
- strncat(s,q,2); q += 3;
- strncat(s,q,2); q += 3;
- strncat(s,q,2); q += 3;
- strncat(s,q,2);
- for(q=s;*q != '\0';q++)
- if (*q == ' ') *q = '0';
- return(s);
- }
-