1MKDTEMP(3)                 Linux Programmer's Manual                MKDTEMP(3)
2
3
4

NAME

6       mkdtemp - create a unique temporary directory
7

SYNOPSIS

9       #include <stdlib.h>
10
11       char *mkdtemp(char *template);
12

DESCRIPTION

14       The  mkdtemp()  function generates a uniquely-named temporary directory
15       from template. The last six characters of template must be  XXXXXX  and
16       these  are replaced with a string that makes the directory name unique.
17       The directory is then created with permissions 0700.  Since it will  be
18       modified,  template  must  not  be  a  string  constant,  but should be
19       declared as a character array.
20

RETURN VALUE

22       The mkdtemp() function returns  a  pointer  to  the  modified  template
23       string  on  success,  and  NULL  on failure, in which case errno is set
24       appropriately.
25

ERRORS

27       EINVAL The last six characters of template were not XXXXXX.   Now  tem‐
28              plate is unchanged.
29
30
31       Also see mkdir(2) for other possible values for errno.
32
33

CONFORMING TO

35       This funtion is present on the BSDs.
36

VERSION

38       Available since glibc 2.1.91.
39

SEE ALSO

41       mkdir(2), mkstemp(3), mktemp(3), tempnam(3), tmpfile(3), tmpnam(3)
42
43
44
45GNU                               2001-10-07                        MKDTEMP(3)
Impressum