Hello.
I'd like to use the fonction FILE *tmpfile() from stdio, to use a file without having to write one on mc or hdd.
This fonction normaly create a temporary file, which can be use like a normal file open with fopen().
But this fonction always return NULL pointer, in my prog. :(
So, who can explain me how to use this fonction.
With a little example if possible. ;)
Thanks
Best regards
Polo
How-to use tmpfile fonction.
it's normal
the used function is not fully implemented and always return NULL.
so you know now what to do : contribute to the SDK developement :)
Code: Select all
/*
**
** [func] - tmpfile.
** [desc] - attempts to create a temporary file. if able to create a temporary
** file then returns the pointer to the FILE stream. else returns NULL.
** [entr] - none.
** [exit] - FILE *; the ptr. to the opened temp. file if successful. else NULL.
** [prec] - none.
** [post] - a temporary is opened.
**
*/
FILE *tmpfile(void)
{
return ((tmpnam(NULL) != NULL) ? fopen(__stdio_tmpnam, "rw+") : NULL);
}
Code: Select all
/*
**
** [func] - tmpnam.
** [desc] - creates a temporary filename string,
** [entr] - char *name; the pointer to the destination string pointer.
** [exit] - char *;
** [prec] -
** [post] -
**
*/
char *tmpnam(char *name)
{
char *ret = NULL;
return (ret);
}
so you know now what to do : contribute to the SDK developement :)