mktemp man page on Cygwin

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

MKTEMP(3)			    NEWLIB			     MKTEMP(3)

NAME
       4.41 `mktemp', `mkstemp', `mkstemps'--generate unused file name

SYNOPSIS
	    #include <stdlib.h>
	    char *mktemp(char *PATH);
	    char *mkdtemp(char *PATH);
	    int mkstemp(char *PATH);
	    int mkstemps(char *PATH, int SUFFIXLEN);

	    char *_mktemp_r(struct _reent *REENT, char *PATH);
	    char *_mkdtemp_r(struct _reent *REENT, char *PATH);
	    int *_mkstemp_r(struct _reent *REENT, char *PATH);
	    int *_mkstemps_r(struct _reent *REENT, char *PATH, int LEN);

DESCRIPTION
       `mktemp',  `mkstemp',  and  `mkstemps'  attempt to generate a file name
       that is not yet in use for any existing file.  `mkstemp' and `mkstemps'
       create  the  file  and open it for reading and writing; `mktemp' simply
       generates the file name (making `mktemp' a security  risk).   `mkdtemp'
       attempts	 to  create  a directory instead of a file, with a permissions
       mask of 0700.

	  You supply a simple pattern for the  generated  file	name,  as  the
       string at PATH.	The pattern should be a valid filename (including path
       information if you wish) ending with at	least  six  ``X''  characters.
       The generated filename will match the leading part of the name you sup‐
       ply, with the trailing ``X'' characters replaced by some combination of
       digits  and  letters.   With  `mkstemps', the ``X'' characters end SUF‐
       FIXLEN bytes before the end of the string.

	  The alternate functions `_mktemp_r', `_mkdtemp_r', `_mkstemp_r', and
       `_mkstemps_r'  are  reentrant  versions.	 The extra argument REENT is a
       pointer to a reentrancy structure.

RETURNS
       `mktemp' returns the pointer PATH to the modified  string  representing
       an  unused  filename,  unless it could not generate one, or the pattern
       you provided is not suitable for a filename; in that case,  it  returns
       `NULL'.

	  `mkdtemp'  returns  the  pointer  PATH to the modified string if the
       directory was created, otherwise it returns `NULL'.

	  `mkstemp' and `mkstemps' return a file descriptor to the newly  cre‐
       ated file, unless it could not generate an unused filename, or the pat‐
       tern you provided is not suitable for a	filename;  in  that  case,  it
       returns `-1'.

PORTABILITY
       ANSI  C	does  not  require  either `mktemp' or `mkstemp'; the System V
       Interface Definition requires `mktemp'  as  of  Issue  2.   POSIX  2001
       requires	 `mkstemp',  and POSIX 2008 requires `mkdtemp', but `mkstemps'
       is not standardized.

	  Supporting  OS  subroutines  required:  `getpid',  `mkdir',  `open',
       `stat'.

SEE ALSO
       mktemp  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			     MKTEMP(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