10046 mktemp should support templates not located at the end of templates

Review Request #2202 - Created July 27, 2019 and updated

Information
Robert Lankford
illumos-gate
Reviewers
general

10046 mktemp should support templates not located at the end of templates

I've tested the new functionality of the mktemp command which includes a -s flag allowing a suffix to be passed. In addition, I've regression tested all existing functionality.

bob@omniosce:/tmp/tmp.DDaGIR$ mktemp
/tmp/tmp.rNaWKR
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp -d
/tmp/tmp.yZa4KR
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp -s .txt
/tmp/tmp.AUaiLR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp -s .txt -d
/tmp/tmp.LwayLR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp -s .txt XXXXXX
_daOLR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp -s .txt -d XXXXXX
yDaWLR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp XXXXXXX.txt
XE1aaMR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ ls -l XE1aaMR.txt
-rw------- 1 bob other 0 Jul 27 00:05 XE1aaMR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ mktemp -d XXXXXX.txt
48aqMR.txt
bob@omniosce:/tmp/tmp.DDaGIR$ ls -ld 48aqMR.txt/
drwx------ 2 bob other 117 Jul 27 00:05 48aqMR.txt/

Issues

  • 7
  • 12
  • 6
  • 25
Description From Last Updated
The mkdtemps function needs to be added to this section. Robert Mustacchi Robert Mustacchi
Th mkdtemps function needs to be added here. Note it is not a standard interface, so we'll need to think ... Robert Mustacchi Robert Mustacchi
I don't think we want to cast this to an int. That'll effectively truncate a size_t down to an int ... Robert Mustacchi Robert Mustacchi
You should update the date for your change. Robert Mustacchi Robert Mustacchi
Perhaps note here that in addition to -s suffix, we also support the long form --suffix? Robert Mustacchi Robert Mustacchi
You should probably put suffix in markup here, I think you want \fIsuffix\fR, to indicate that it's referring to the ... Robert Mustacchi Robert Mustacchi
Another spot where we'll need to update the date. Robert Mustacchi Robert Mustacchi
Yuri Pankov
Toomas Soome
Robert Mustacchi
Robert Lankford
Robert Mustacchi

   
usr/src/lib/libc/port/gen/mkdtemp.c (Diff revision 6)
 
 
I don't think we want to cast this to an int. That'll effectively truncate a size_t down to an int (so a potentially 64-bit value to a 32-bit one). I would probably cast up slen to a size_t in the comparison.
usr/src/man/man1/mktemp.1 (Diff revision 6)
 
 
You should update the date for your change.
usr/src/man/man1/mktemp.1 (Diff revision 6)
 
 
Perhaps note here that in addition to -s suffix, we also support the long form --suffix?
usr/src/man/man1/mktemp.1 (Diff revision 6)
 
 

You should probably put suffix in markup here, I think you want \fIsuffix\fR, to indicate that it's referring to the actual argument.

usr/src/man/man3c/mkstemp.3c (Diff revision 6)
 
 
Another spot where we'll need to update the date.
Loading...