mktemp.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 127 行

1
127
字号
.TH mktemp 1.SH Namemktemp \- make a name for a temporary file.SH Syntax.B mktemp [.B \-c][.B \-d.I directory_name] [.B \-p.I prefix] .SH DescriptionThe.PN mktempcommand makes a name for the pathname of a temporaryfile and writes that name to standard output. The namewill not duplicate that of an existing file. The.PN mktempcommand does not create a new file. The file named must actually becreated before .PN mktempcan generate a new filename..PPSubsequent calls to.PN mktempwill only generate a new file name if all previously generated file names have been created by the user and still exist. Error messages arewritten to standard error..PPThe .I directory_name generated by.PN mktempis the concatenation of a directory name, a slash (/), a file prefix, adot (.), a four digit number and a unique character..PPThe directory name is chosen as follows:.RS 3.TP 5(1) If the \fB\-d\fR option is specified, \fIdirectory_name\fR is used..TP(2) Otherwise, if the TMPDIR environment variable is set anda string that would yield a unique name can be obtained using the valueof that variable as a directory name, this value is used..TP(3) Otherwise, .PN /tmp is used..RE.PPThe .I prefix is chosen as follows:.RS 3.TP 5(1) If the \fB\-p\fR option is specified, \fIprefix\fR is used..TP(2) Otherwise, if the LOGNAME environment variable is set, itis used as the .I prefix..TP(3) Otherwise, the user's login name is used..RE.SH Options.IP \-c 12Causes .PN mktemp to attempt to create a regular file using the generated(or created) name string. If file creation is successful, a zero length fileis created with access permissions derived from the process's file mode creation mask, see .MS umask 2 .No attempt is made to create a file if the lengthof the generated (or created) name string exceeds 1023 characters. It is theuser's responsibility to remove files created by use of this option..IP "\-d \fIdirectory_name\fP"Causes \fIdirectory_name\fR to be used as the directory portion of the pathname. In this case, \fIdirectory_name\fR is used instead ofTMPDIR and .PN /tmp. .IP "\-p \fIprefix\fP"Causes the string \fIprefix\fR to be used as the file's .I prefix. It is usedinstead of LOGNAM and the user's login name. If the \fIprefix\fRis longer the 249 characters, it will be silently truncated to that length before the concatenation of the suffix..SH Environmental Variables.TP 12 LOGNAMEWhen the \fB\-p\fI prefix\fR option is not specified, the value of thisvariable is used as the .I prefix of the filename, if it exists..TPTMPDIRWhen the \fB\-d\fI directory_name\fR option is not specified, the valueof this variable is used instead of .PN /tmp ..SH RestrictionsIf the user does not have write permission in the directory specified,and error message is reported and .PN /tmpis used in its place. Theentire path name can not exceed 1023 characters, and the temporary filename can not exceed 255 characters. If the generated file name is toolong it is truncated to fit before the suffix is added..SH See Also.MS stat 2 ,.MS umask 2 ,.MS mktemp 3 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?