rmtmp
raw OCR
Removes temporary files.
Defined in header <stdio.h>
Syntax
#include <stdio.h>
int rmtmp(void);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
The rmtmp function closes and deletes all open temporary file streams, which were previously created with tmpfiie. The current directory must the same as when the files were created, or the files will not be deleted.
Return value
rmtmp returns the total number of temporary files it closed and deleted.
See also
tmpfil
Example
#include <stdio.h>
#include <process.h>
void mainO
{
FILE *stream;
int i;
/* Create temporary files */
for (i = 1; i <= 10; i++) {
if ((stream = tmpfileO) == NULL).
perror("Could not open temporary file\n");
else
printf("Temporary file %d created\n", i);
}
/* Remove temporary files */
if (stream != NULL)
printf{"%d temporary files deleted\n", rmtmp (
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `rmtrnp` read as `rmtmp`
Stable link: /3.1/stdio.h/rmtmp/
· short form /3.1/rmtmp/