sbase

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

mktemp.1 (1099B)


      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.
     17 If no
     18 .Ar template
     19 is specified, a default of 'tmp.XXXXXXXXXX' is used and the
     20 tmpdir set to '/tmp' or, if set, the TMPDIR environment variable.
     21 .Sh OPTIONS
     22 .Bl -tag -width Ds
     23 .It Fl d
     24 Create a temporary directory instead of a file.
     25 .It Fl p Ar directory
     26 Use the specified
     27 .Ar directory
     28 as a prefix when generating the temporary filename.
     29 The directory will be overridden by the user's
     30 .Ev TMPDIR
     31 environment variable if it is set.
     32 This option implies the
     33 .Fl t
     34 flag (see below).
     35 .It Fl q
     36 Fail silently if an error occurs.
     37 .It Fl t
     38 Generate a path rooted in a temporary directory.
     39 .It Fl u
     40 Unlink file before
     41 .Nm
     42 exits.
     43 This is slightly better than
     44 .Xr mktemp 3
     45 but still introduces a race condition.
     46 Use of this option is not encouraged.
     47 .El
     48 .Sh SEE ALSO
     49 .Xr mkdtemp 3 ,
     50 .Xr mkstemp 3