tmpnam man page on Cygwin

Man page or keyword search:  
man Server   22533 pages
apropos Keyword Search (all sections)
Output format
Cygwin logo
[printable version]

TMPNAM(3)			    NEWLIB			     TMPNAM(3)

NAME
       4.65 `tmpnam', `tempnam'--name for a temporary file

SYNOPSIS
	    #include <stdio.h>
	    char *tmpnam(char *S);
	    char *tempnam(char *DIR, char *PFX);
	    char *_tmpnam_r(struct _reent *REENT, char *S);
	    char *_tempnam_r(struct _reent *REENT, char *DIR, char *PFX);

DESCRIPTION
       Use  either of these functions to generate a name for a temporary file.
       The generated name is guaranteed to avoid collision  with  other	 files
       (for up to `TMP_MAX' calls of either function).

	  `tmpnam'  generates file names with the value of `P_tmpdir' (defined
       in ``stdio.h'') as the leading directory component of the path.

	  You can use the `tmpnam' argument S to specify a  suitable  area  of
       memory  for  the	 generated  filename;  otherwise,  you	can call `tmp‐
       nam(NULL)' to use an internal static buffer.

	  `tempnam' allows you more control over the generated	filename:  you
       can  use the argument DIR to specify the path to a directory for tempo‐
       rary files, and you can use the argument PFX to specify	a  prefix  for
       the base filename.

	  If  DIR  is `NULL', `tempnam' will attempt to use the value of envi‐
       ronment variable `TMPDIR' instead; if there is no such value, `tempnam'
       uses the value of `P_tmpdir' (defined in ``stdio.h'').

	  If you don't need any particular prefix to the basename of temporary
       files, you can pass `NULL' as the PFX argument to `tempnam'.

	  `_tmpnam_r' and `_tempnam_r' are reentrant versions of `tmpnam'  and
       `tempnam'  respectively.	  The  extra  argument REENT is a pointer to a
       reentrancy structure.

       *Warnings*
       The generated filenames are suitable for temporary files, but do not in
       themselves  make files temporary.  Files with these names must still be
       explicitly removed when you no longer want them.

	  If you supply your own data area S for  `tmpnam',  you  must	ensure
       that it has room for at least `L_tmpnam' elements of type `char'.

RETURNS
       Both  `tmpnam'  and  `tempnam'  return a pointer to the newly generated
       filename.

PORTABILITY
       ANSI C requires `tmpnam', but does not specify the use  of  `P_tmpdir'.
       The  System V Interface Definition (Issue 2) requires both `tmpnam' and
       `tempnam'.

	  Supporting OS subroutines  required:	`close',   `fstat',  `getpid',
       `isatty', `lseek', `open', `read', `sbrk', `write'.

	  The global pointer `environ' is also required.

SEE ALSO
       tmpnam  is  part	 of  the library.  The full documentation for is main‐
       tained as a Texinfo manual.  If info and are properly installed at your
       site, the command

	      info

       will give you access to the complete manual.

NEWLIB				  April 2010			     TMPNAM(3)
[top]

List of man pages available for Cygwin

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net