]> diplodocus.org Git - nmh/blob - man/mh-mkstemp.man
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / man / mh-mkstemp.man
1 .TH MH-MKSTEMP %manext1% "March 16, 2014" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 mkstemp \- create a temporary file
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B %nmhlibexecdir%/mkstemp
11 .RB [ \-help ]
12 .RB [ \-version ]
13 .RB [ \-directory
14 .IR directory ]
15 .RB [ \-prefix
16 .IR prefix ]
17 .RB [ \-suffix
18 .IR suffix ]
19 .ad
20 .SH DESCRIPTION
21 .B mkstemp
22 creates a temporary file using
23 .IR mkstemp (3),
24 or if the
25 .B \-suffix
26 switch is available and used,
27 .IR mkstemps (3).
28 The file name identifies a unique, newly created file, and always
29 contains 6 characters that appear to be random.
30 .PP
31 The
32 .B \-directory
33 switch specifies a
34 .I directory
35 in which to create the file.
36 .PP
37 The
38 .B \-prefix
39 switch specifies an initial part, before the 6 characters, of the file
40 name.
41 .PP
42 The
43 .B \-suffix
44 switch is only supported on platforms that provide the
45 .IR mkstemps (3)
46 library function. It specifies a
47 .I suffix
48 to appear after the 6 characters; if it should begin with a special
49 character such as a period, that must be explicit in
50 .IR suffix .
51 .PP
52 Unlike arguments to most switches of other
53 .B nmh
54 commands, the arguments to
55 .B mkstemp
56 switches can begin with a dash.
57 .SH "EXIT STATUS"
58 If
59 .B mkstemp
60 successfully creates the temporary file, it prints the file name on
61 standard output and exits with status 0. On failure, it prints a
62 diagnostic message on standard error and exits with status -1.
63 .SH "PROFILE COMPONENTS"
64 None
65 .SH "SEE ALSO"
66 .IR mkstemp (3),
67 .IR mkstemps (3)
68 .SH DEFAULTS
69 .PD 0
70 .TP 14
71 \-directory
72 current directory
73 .TP
74 \-prefix
75 none
76 .TP
77 \-suffix
78 none
79 .PD