Name
rmtmp - Closes and deletes all temporary files in the
current directory.
Syntax
#include <stdio.h>
int rmtmp(void)
Description
The rmtmp routine is used to close and delete all the
temporary files in the current directory. The function
removes only those files created by tmpfile and should be
used only in the same directory in which the temporary files
were created.
Return Value
The rmtmp function returns the number of temporary files
closed and deleted.
See Also
flushall(DOS), tmpfile(S), tmpnam(S)
Example
#include <stdio.h>
FILE *stream;
main()
{
int numdeleted;
/* Create a temporary file: */
if ((stream = tmpfile()) == NULL)
perror("Could not open new temporary file");
/* Remove a temporary file: */
numdeleted = rmtmp();
printf("Number of closed files deleted in current "
"directory = %d\n", numdeleted);
}
This program creates a temporary file, then uses rmtmp to
delete this file.
(printed 6/18/89)