On Tue, 16 Jun 2009 20:46:11 +0200 Casper.Dik at Sun.COM wrote:
> >not the same as solars mktemp(1)
> >subtle difference is if the creat/mkdir happens or not
> >and if it does -u does an unlink/rmdir
> >
> >     -u              Operate in unsafe mode.  The  temp  file  is
> >                     unlinked   before   mktemp  exits.  This  is
> >                     slightly better than mktemp(3C),  but  still
> >                     introduces  a  race  condition.  Use of this
> >                     option is discouraged.

> In GNU or ksh93?  It's merely semantics, I think,; you can't make sure 
> that a filename is unique other than creating it with O_EXCL so we
> need to unlink and we're certain that the file was unique at some
> point in time.  I think they have the same "root" but someone didn't 
> properly clone mktemp().  

the -u description I quoted was from the solaris mktemp(1)

its not semantics assuming the gnu and solaris documentation describe the 
implementation

gnu --dry-run prints the name it would use to creat the file
but stops short of doing the creat

solaris -u does a creat, unlink, and then prints the name

presumably solaris -u could fail in the creat/unlink steps that gnu bypasses

the ksh mktemp builtin -u implementation follows the solaris docs


Reply via email to