Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
NAME
tmpfile - create a temporary file
SYNOPSIS
#include <stdio.h>
FILE *tmpfile (void);
DESCRIPTION
The tmpfile() function generates a unique temporary file-
name using the path prefix P_tmpdir defined in <stdio.h>.
The temporary file is then opened in binary read/write
(w+b) mode. The file will be automatically deleted when
it is closed or the program terminates.
RETURN VALUE
The tmpfile() function returns a stream descriptor, or
NULL if a unique filename cannot be generated or the
unique file cannot be opened.
SEE ALSO
mktemp(3), mkstemp(3), tmpnam(3), tempnam(3)
On Tue, 11 Jun 2002, Mark Haidekker wrote:
> On Tuesday 11 June 2002 01:16 pm, you wrote:
> > What do people do in C programming (for example) in writing temp files to
> > avoid conflicts when multiple instances of the program run simultaneously?
> > Do you make up some random string, or use the system clock to get a
> > string? What's a conventional approach to this?
> >
> > Mike
>
> If I remember correctly, C has a special function to generate a random file
> name. I ran across this function recently when dealing with fifos, but can't
> remember the name.
>
> Mark
> --
> To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
>
> Archives are available at http://mlug.missouri.edu/list-archives/
>
--
To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
Archives are available at http://mlug.missouri.edu/list-archives/