[Toybox] New toy: mktemp

Elie De Brauwer eliedebrauwer at gmail.com
Tue May 1 02:55:24 PDT 2012


Hi all,

In attachment you can find an implementation of mktemp. Sample usage:

edb at lapedb:~/$ ./toybox mktemp /tmp/tmp.WMF6SY
edb at lapedb:~/$ ./toybox mktemp -d /tmp/tmp.YFhKgH
edb at lapedb:~/$ ./toybox mktemp -p /tmp/tmp.YFhKgH  buggerXXXXXX
/tmp/tmp.YFhKgH/bugger6eO4NL
edb at lapedb:~/$ ./toybox mktemp -p /tmp/tmp.YFhKgH -d dirXXXXXX
/tmp/tmp.YFhKgH/dirsY7mM7

edb at lapedb:~/$ ls -Rl /tmp/tmp.YFhKgH
/tmp/tmp.YFhKgH:
total 0
-rw------- 1 edb edb  0 May  1 11:47 bugger6eO4NL
drwx------ 2 edb edb 40 May  1 11:47 dirsY7mM7

/tmp/tmp.YFhKgH/dirsY7mM7:
total 0

Btw gnu mktemp places files by default in /tmp, busybox mktemp puts them 
by default in ., I've decided to follow the gnu approach

my 2 cents
E.


-- 
Elie De Brauwer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mktemp.patch
Type: text/x-patch
Size: 1709 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120501/039a5187/attachment-0006.bin>


More information about the Toybox mailing list