mkstemp man page on IRIX

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



MKTEMP(3C)							    MKTEMP(3C)

NAME
     mktemp, mkstemp - make a unique file name

SYNOPSIS
     #include <stdio.h>

     char *mktemp (char *template);

     int mkstemp(char *template);

DESCRIPTION
     Mktemp replaces the contents of the string pointed to by template by a
     unique file name, and returns the address of template.  The string in
     template should look like a file name with six trailing Xs; mktemp will
     replace the Xs with a string that can be used to create a unique file
     name.

     Mkstemp makes the same replacement to the template but returns a file
     descriptor for the template file open for reading and writing.  Mkstemp
     avoids the race between testing whether the file exists and opening it
     for use.

     The mkstemp routine is from the 4.3BSD standard C library.

SEE ALSO
     getpid(2), tmpfile(3S), tmpnam(3S).

DIAGNOSTICS
     Mktemp will assign a zero to the first character of template if it cannot
     create a unique name, returning the empty string.

     Mkstemp returns an open file descriptor upon success.  It returns -1 if
     no suitable file could be created.

CAVEAT
     Mktemp makes 26 attempts to generate a filename which is not currently in
     use from a given template.	 Since the filename generated uses the process
     ID as a base, it is highly unlikely that these names will conflict with
     those generated by another process.  Variation in the contents of the
     actual string given to mktemp, as well as the number of times mktemp is
     called, will determine the likelihood of successfully generating a unique
     name.

									Page 1

[top]

List of man pages available for IRIX

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