version 1 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
TEMPFILE |
|
|
2 |
!!!TEMPFILE |
|
|
3 |
NAME |
|
|
4 |
SYNOPSYS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
RETURN VALUES |
|
|
8 |
BUGS |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
tempfile - create a temporary file in a safe manner |
|
|
15 |
!!SYNOPSYS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__tempfile__ [[-d DIR] [[-p STRING] [[-m MODE] [[-n FILE] |
|
|
19 |
[[--directory=DIR] [[--prefix=STRING] [[--mode=MODE] |
|
|
20 |
[[--name=FILE] [[--help] [[--version] |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__tempfile__ creates a temporary file in a safe manner. |
|
|
25 |
It uses tempnam(3) to choose the name and opens it |
|
|
26 |
with O_RDWR | O_CREAT | O_EXCL. The filename is printed on |
|
|
27 |
standard output. |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
The directory to place the file is searched for in the |
|
|
31 |
following order: |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
a) |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
The directory specified by the environment variable |
|
|
38 |
__TMPDIR__, if it is writable. |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
b) |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
The directory specified by the __--directory__ argument, |
|
|
45 |
if given. |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
c) |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
The directory ''/tmp''. |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
Debian packages using __tempfile__ in maintainer scripts |
|
|
55 |
must depend on debianutils __ |
|
|
56 |
!!OPTIONS |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
__-d, --directory__ ''DIR'' |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
Place the file in DIR. |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
__-p, --prefix__ ''STRING'' |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
Use up to five letters of STRING to generate the |
|
|
69 |
name. |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
__-s, --suffix__ ''STRING'' |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
Generate the file with STRING as the suffix. |
|
|
76 |
|
|
|
77 |
|
|
|
78 |
__-m, --mode__ ''MODE'' |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
Open the file with MODE instead of 0600. |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
__-n, --name__ ''FILE'' |
|
|
85 |
|
|
|
86 |
|
|
|
87 |
Use FILE for the name instead of tempnam(3)__.__ |
|
|
88 |
The options -d, -p, and -s are ignored if this option is |
|
|
89 |
given. |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
__--help__ |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
Print a usage message on standard output and exit |
|
|
96 |
succesfully. |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
__--version__ |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
Print version information on standard output and exist |
|
|
103 |
succesfully. |
|
|
104 |
!!RETURN VALUES |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
An exit status of 0 means the temporary file was created |
|
|
108 |
succesfully. Any other exit status indicates an |
|
|
109 |
error. |
|
|
110 |
!!BUGS |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
Exclusive creation is not guaranteed when creating files on |
|
|
114 |
NFS partitions. |
|
|
115 |
!!SEE ALSO |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
tempnam(3) |
|
|
119 |
---- |