mktemp - make a unique temporary filename


   #include <stdlib.h>

   char *mktemp(char *template);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

       Since glibc 2.12:
           (_XOPEN_SOURCE >= 500) && ! (_POSIX_C_SOURCE >= 200112L)
               || /* Glibc since 2.19: */ _DEFAULT_SOURCE
               || /* Glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
       Before glibc 2.12:
           _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500


   Never use this function; see BUGS.

   The  mktemp()  function  generates  a  unique  temporary  filename from
   template.  The last six characters of template must be XXXXXX and these
   are  replaced  with  a string that makes the filename unique.  Since it
   will be modified, template must not be a string constant, but should be
   declared as a character array.


   The  mktemp()  function  always returns template.  If a unique name was
   created, the last six bytes of template will have been modified in such
   a  way that the resulting name is unique (i.e., does not exist already)
   If a unique name could not  be  created,  template  is  made  an  empty
   string, and errno is set to indicate the error.


   EINVAL The last six characters of template were not XXXXXX.


   For   an   explanation   of   the  terms  used  in  this  section,  see

   Interface  Attribute      Value   
   mktemp()   Thread safety  MT-Safe 


   4.3BSD,  POSIX.1-2001.   POSIX.1-2008  removes  the  specification   of


   Never  use  mktemp().   Some  implementations follow 4.3BSD and replace
   XXXXXX by the current process ID and a single letter, so that  at  most
   26  different  names  can be returned.  Since on the one hand the names
   are easy to guess, and on the  other  hand  there  is  a  race  between
   testing  whether  the  name  exists  and opening the file, every use of
   mktemp() is a security risk.  The race is  avoided  by  mkstemp(3)  and


   mktemp(1), mkdtemp(3), mkstemp(3), tempnam(3), tmpfile(3), tmpnam(3)


   This  page  is  part of release 4.09 of the Linux man-pages project.  A
   description of the project, information about reporting bugs,  and  the
   latest     version     of     this    page,    can    be    found    at

More Linux Commands

perlmacos(1) - Perl under Mac OS (Classic) - Linux man page
The port of Perl to to Mac OS was officially removed as of Perl 5.12, though the last official production release of MacPerl corresponded to Perl 5.6. While Per

glut(3) - an introduction to the OpenGL Utility Toolkit.....
The OpenGL Utility Toolkit (GLUT) is a programming interface with ANSI C and FORTRAN bindings for writing window system independent OpenGL programs. The toolkit

acosl(3) - arc cosine function (Library - Linux man page)...
The acos() function calculates the arc cosine of x; that is the value whose cosine is x. RETURN VALUE On success, these functions return the arc cosine of x in

gitremote-helpers(1) Helper programs to interact with remote
Remote helper programs are normally not used directly by end users, but they are invoked by Git when it needs to interact with remote repositories Git does not

lobase(1) - LibreOffice office suite - Linux manual page....
LibreOffice (LO for short) is a multi-platform office productivity suite. It was derived from 3.3 Beta on September 28, 2010. libreoffice is a sh

ldap_parse_result(3) - Parsing results - Linux manual page
These routines are used to extract information from a result message. They will operate on the first result message in a chain of search results (skipping past

gnutls_x509_crl_check_issuer(3) - API function (Man Page)...
This function will check if the given CRL was issued by the given issuer certificate. It will return true (1) if the given CRL was issued by the given issuer, a

ber_get_int(3) - OpenLDAP LBER simplified Basic Encoding Rul
These routines provide a subroutine interface to a simplified implementation of the Basic Encoding Rules of ASN.1. The version of BER these routines support is

netconfig(5) - network configuration data base (Man Page)...
The netconfig file defines a list of transport names, describing their semantics and protocol. In FreeBSD, this file is only used by the RPC library code. Entri

usleep(1) - sleep for the specified number of microseconds
usleep pauses for the number of usec microseconds. The default is 1 microsecond. If 0 microseconds are specified sched_yield(2) is called. BUGS The usleep progr

erb(1) Ruby Templating (Commands - Linux manual page).......
erb is a command line front-end for ERB library, which is an implementation of eRuby. ERB provides an easy to use but powerful templating system for Ruby. Using

git-send-pack(1) - Push objects over git protocol to another
Usually you would want to use git push, which is a higher-level wrapper of this command, instead. See git-push(1). Invokes git-receive-pack on a possibly remote

We can't live, work or learn in freedom unless the software we use is free.