sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

mktemp.1 (1100B)


      1 .Dd 2015-10-08
      2 .Dt MKTEMP 1
      3 .Os sbase
      4 .Sh NAME
      5 .Nm mktemp
      6 .Nd create temporary file or directory
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Fl dqtu
     10 .Op Fl p Ar directory
     11 .Op Ar template
     12 .Sh DESCRIPTION
     13 .Nm
     14 creates a temporary file by generating a unique filename with
     15 .Ar template ,
     16 which has to have at least six 'X's appended to it.  If no
     17 .Ar template
     18 is specified, a default of 'tmp.XXXXXXXXXX' is used and the
     19 tmpdir set to '/tmp' or, if set, the TMPDIR environment variable.
     20 .Sh OPTIONS
     21 .Bl -tag -width Ds
     22 .It Fl d
     23 Create a temporary directory instead of a file.
     24 .It Fl p Ar directory
     25 Use the specified
     26 .Ar directory
     27 as a prefix when generating the temporary filename. The directory will be
     28 overridden by the user's
     29 .Ev TMPDIR
     30 environment variable if it is set. This option implies the
     31 .Fl t
     32 flag (see below).
     33 .It Fl q
     34 Fail silently if an error occurs.
     35 .It Fl t
     36 Generate a path rooted in a temporary directory.
     37 .It Fl u
     38 Unlink file before
     39 .Nm
     40 exits. This is slightly better than
     41 .Xr mktemp 3
     42 but still introduces a race condition. Use of this option is not encouraged.
     43 .El
     44 .Sh SEE ALSO
     45 .Xr mkdtemp 3 ,
     46 .Xr mkstemp 3