blob: 06662dd768ae1a878e15d4c7a89320274c5cfdc2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <stdio.h>
/** open a temporary file stream **/
FILE * tmpfile(void)
{
char *path = "FIXME: A temporary file name *not* calling tmpnam()";
FILE *f = fopen(path, "w+");
if (f) {
/* FIXME: set flag for temporary in FILE struct */
} else {
/* FIXME: set errno */
}
/*
RETURN_SUCCESS(a pointer to the temporary file stream);
RETURN_FAILURE(CONSTANT(NULL));
*/
return f;
}
/***
creates a temporary binary file stream for update (as
when ARGUMENT(mode) is specified as LITERAL("wb+") to FUNCTION(fopen)).
The file stream will be automatically removed when closed by FUNCTION(fclose)
or when the program exits.
***/
/*
IMPLEMENTATION(Whether the temporary file is removed if the program terminates abnormally)
STDC(1)
*/
|