mkdtempのヘルプ・マニュアル
日本語 英語
mkdtemp --help
man mkdtemp
MKDTEMP(3) Linux Programmer’s Manual MKDTEMP(3)
名前
mkdtemp - 他と重ならない一時的なディレクトリを作成する
書式
#include
char *mkdtemp(char *template);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
mkdtemp(): _BSD_SOURCE
説明
mkdtemp() 関数は、他と重ならない名前の一時的なディレクトリを template
から作成する。 template の後から 6 文字は XXXXXX でなければならない。こ
の 部分はディレクトリ名を他と重ならなくするための文字列で置き換えられる
。ディレクトリは許可属性を 0700 として作成される。 template は変更さ れ
るので、文字列定数にしてはならず、文字配列にすべきである。
返り値
成功した場合、 mkdtemp() 関数は変更された template 文字列へのポインタを
返す。失敗した場合は、NULL を返して、 errno を適切に設定する。
エラー
EINVAL template の後ろから 6 文字が XXXXXX でない。この場 合 、template
は変更されない。
errno に設定される他の値については、 mkdir(2) を参照すること。
バージョン
OpenBSD 2.2 で導入された。
準拠
POSIX.1-2008. この関数は BSD に存在する。
関連項目
mkdir(2), mkstemp(3), mktemp(3), tempnam(3), tmpfile(3), tmpnam(3)
GNU 2008-08-21 MKDTEMP(3)
MKDTEMP(3) Linux Programmer’s Manual MKDTEMP(3)
NAME
mkdtemp - create a unique temporary directory
SYNOPSIS
#include
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
appropriately.
ERRORS
EINVAL The last six characters of template were not XXXXXX. Now tem-
plate 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.22 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)