Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tempnam.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tempnam.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tempnam.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tempnam.html on line 8
Create a name for a temporary file
#include <stdio.h>
char* tempnam( const char* dir,
const char* pfx );
- dir
- NULL, or the directory to use in the pathname.
- pfx
- NULL, or a prefix to use in the pathname.
|
If pfx isn't NULL, the string it points to must
be no more than 5 bytes long.
|
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The tempnam() function generates a pathname for use as a
temporary file. The pathname is in the directory specified by
dir and has the prefix specified in pfx.
If dir is NULL, the pathname is prefixed
with the first accessible directory contained in:
- the temporary file directory P_tmpdir (defined in
<stdio.h>)
- the TMPDIR environment variable
- the _PATH_TMP constant (defined in
<paths.h>).
If all of these paths are inaccessible, tempnam() attempts
to use /tmp and then the current working directory.
The tempnam() function generates
up to TMP_MAX unique file
names before it starts to recycle them.
A pointer to the generated file name, which you should deallocate with
the free() function when
the application no longer needs it, or NULL if an error
occurs.
- ENOMEM
- There's insufficient memory available to create the pathname.
POSIX 1003.1 XSI
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
The tempnam() functions creates only pathnames; the application
must create
and remove the files.
It's possible for another thread or process to create a file with the
same name between the time the pathname is created and the file is opened.
free(),
tmpfile(),
tmpnam(),
unlink()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tempnam.html on line 180
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tempnam.html on line 180