home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - tmpfile.c
- *
- * function(s)
- * tmpfile - creates a unique temporary file
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
-
- #include <stdio.h>
- #include <_stdio.h>
-
- /*---------------------------------------------------------------------*
-
- Name tmpfile - creates a unique temporary file
-
- Usage #include <stdio.h>
- FILE *tmpfile(void);
-
- Prototype in stdio.h
-
- Return value On successful completion, the associated stream.
- In the event of error, NULL is returned.
-
- *---------------------------------------------------------------------*/
- FILE *tmpfile(void)
- {
- FILE *stream;
- char *s;
-
- s = tmpnam(NULL); /* Get a unique file name */
- if ((stream = fopen(s, "w+b")) != NULL)
- stream->istemp = _tmpnum;
-
- return (stream);
- }
-