On Sun, 8 Jun 2008, Denys Vlasenko wrote:

> Help test says nothing about default pattern (in the name of keeping
> not-so essential info from bloating it). So where is the lie?

Please, don't pay too much attention to my rambings :)

> >   # ./busybox mktemp
> >   tmp.XXXX8khaJC
>
> I don't see how this contradicts help text -

Maybe not...

> # ./busybox mktemp --help
> BusyBox v1.11.0.svn (2008-06-07 21:53:08 CEST) multi-call binary
>
> Usage: mktemp [-dt] [-p DIR] [TEMPLATE]
>
> Create a temporary file with name based on TEMPLATE and print its name.
> TEMPLATE must end with XXXXXX (i.e., /tmp/temp.XXXXXX).
>
> Options:
>         -d      Make a directory instead of a file
>         -t      Generate a path rooted in temporary directory
>         -p DIR  Use DIR as a temporary directory (implies -t)
>
> For -t or -p, directory is chosen as follows:
> $TMPDIR if set, else -p DIR, else /tmp

...but it doesn't give any clue to why the default temp file/dir looks
like this:

# ./busybox mktemp -t;echo $?
/tmp/tmp.XXXXvMGoLS
         ^^^^

And, by the way, the 4 added X:s don't add any entropy to the generated
name.  Just makes the name longer.  Now, that I look more carefully at the
code, I realize that as long as the 'mkdtemp' and 'mkstemp' are used,
things won't get more entropic.  So I have difficulties understanding the
point with changing mktemp :(

> Do you feel that "(i.e., /tmp/temp.XXXXXX)" implies that that is the
> default?

Seeing the extra X:s in the names, confused me.

> Will "(e.g. [/dir]/nameXXXXXX)" do better?

It might.  But the important thing, in my opinion, would be to document
the default behaviour.


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to