Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mkdtemp(3) [suse man page]

MKDTEMP(3)						     Linux Programmer's Manual							MKDTEMP(3)

NAME
mkdtemp - create a unique temporary directory SYNOPSIS
#include <stdlib.h> char *mkdtemp(char *template); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): mkdtemp(): _BSD_SOURCE DESCRIPTION
The mkdtemp() function generates a uniquely named temporary directory from template. The last six characters of template must be XXXXXX and these are replaced with a string that makes the directory name unique. The directory is then created with permissions 0700. Since it will be modified, template must not be a string constant, but should be declared as a character array. RETURN VALUE
The mkdtemp() function returns a pointer to the modified template string on success, and NULL on failure, in which case errno is set appro- priately. ERRORS
EINVAL The last six characters of template were not XXXXXX. Now template is unchanged. Also see mkdir(2) for other possible values for errno. VERSIONS
Available since glibc 2.1.91. CONFORMING TO
POSIX.1-2008. This function is present on the BSDs. SEE ALSO
mkdir(2), mkstemp(3), mktemp(3), tempnam(3), tmpfile(3), tmpnam(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2008-08-21 MKDTEMP(3)

Check Out this Related Man Page

MKDTEMP(3)						     Linux Programmer's Manual							MKDTEMP(3)

NAME
mkdtemp - create a unique temporary directory SYNOPSIS
#include <stdlib.h> char *mkdtemp(char *template); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): mkdtemp(): _BSD_SOURCE || /* Since glibc 2.10: */ (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) DESCRIPTION
The mkdtemp() function generates a uniquely named temporary directory from template. The last six characters of template must be XXXXXX and these are replaced with a string that makes the directory name unique. The directory is then created with permissions 0700. Since it will be modified, template must not be a string constant, but should be declared as a character array. RETURN VALUE
The mkdtemp() function returns a pointer to the modified template string on success, and NULL on failure, in which case errno is set appro- priately. ERRORS
EINVAL The last six characters of template were not XXXXXX. Now template is unchanged. Also see mkdir(2) for other possible values for errno. VERSIONS
Available since glibc 2.1.91. CONFORMING TO
POSIX.1-2008. This function is present on the BSDs. SEE ALSO
mkdir(2), mkstemp(3), mktemp(3), tempnam(3), tmpfile(3), tmpnam(3) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2010-09-26 MKDTEMP(3)
Man Page

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

man pages

When reading man pages, I notice that sometimes commands are follwed by a number enclosed in parenthesis. such as: mkdir calls the mkdir(2) system call. What exactly does this mean? (4 Replies)
Discussion started by: dangral
4 Replies

2. UNIX for Advanced & Expert Users

Special characters getting replaced by &Pound in Unix Environment

Hi, Please find the Question Summary below- In our email template document(.txt) bullets and Apostrophe are getting replaced by the string "&pound" in our Live environment.We are using sun solaris 8 in live. Can anybody let me know why this happens and how to prevent this . Thanks... (0 Replies)
Discussion started by: kaushik05
0 Replies

3. Homework & Coursework Questions

changing permissions of a file whos name was passed to 755

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script that gives a passed file the "755" access permissions. The shell script should: Change... (0 Replies)
Discussion started by: anix007
0 Replies

4. Homework & Coursework Questions

changing permissions of a file whos name was passed to 755

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script that gives a passed file the "755" access permissions. The shell script should: Change... (5 Replies)
Discussion started by: anix007
5 Replies

5. Shell Programming and Scripting

Help with template like solution

hi experts, i'm trying to do this: file1 is a template. might have kinds of 'funny' characters. sample: <body> <form> <p><input type="text" name="abc"/></p> &nbsp; <p><my_content></p> </form> </body> file2 is a file that contains lots of text. this might be very big. might have... (2 Replies)
Discussion started by: xjohnu
2 Replies

6. Homework & Coursework Questions

Creating directories within a directory?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Ok i need to create a directory within another directory in one command. I'm already in a directory to. I need to... (6 Replies)
Discussion started by: gangsta
6 Replies

7. Homework & Coursework Questions

man page for regular expressions and wildcards?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The characters "*", "?", "" have special meaning in Unix. They can either be used on the command line to... (1 Reply)
Discussion started by: jbiz
1 Replies

8. Homework & Coursework Questions

Diplaying man pages

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Give the command line for displaying manual pages for the socket, raed, and connect system calls. What will be... (2 Replies)
Discussion started by: TheLoLGuy
2 Replies

9. Homework & Coursework Questions

FORTRAN error *** glibc detected ***

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I'm doing aproximation of derivative called five-point stencil. For every value of x, in interval , in step... (0 Replies)
Discussion started by: antonija
0 Replies

10. Solaris

Creating a VMware template

Hello, I am creating a Solaris 11 template on my ESXI host. I would like each VM that is deployed from the template to have its own unique host fingerprint. With Linux, I simply delete host keys, which causes new keys to be generated at bootup (new VM deployment) Is there a way to do this... (1 Reply)
Discussion started by: firefoxx04
1 Replies