Todd Lyons ([EMAIL PROTECTED]) wrote: > Vincent Danen wrote on Wed, Aug 28, 2002 at 06:04:01PM -0600 : > > > > You're 100% positive on this? Was it on Mandrake you used 4 X's, or > > BSD? I've got 7.2 up in vmware for some security testing and just > > ran "mktemp file.XXXX" and get the cannot create error, and the > > manpage indicates 6 X's. > > man mktemp on RH 7.1: > The template may be any file name with some number of `Xs' appended > to it, for example /tmp/temp.XXXX. The trailing `Xs' are replaced > with the current process number and/or a unique letter combination. > The number of unique file names mktemp can return depends on the > number of `Xs' provided; six `Xs' will result in mktemp testing > roughly 26 ** 6 combinations. > > However, when you try to do less than 6: > [root@atlantis /root]# mktemp -u fileXXX > Cannot create temp file fileXXX > [root@atlantis /root]# mktemp -u fileXXXXX > Cannot create temp file fileXXXXX > [root@atlantis /root]# mktemp -u fileXXXXXX > fileMdioDs > > The interesting thing is what happens when you go more than 6: > [root@atlantis /root]# mktemp -u fileXXXXXXXX > fileXXsswMeG > > I think I just remembered backwards (ie I wanted more than 6 but could > only get 6). > > > I don't think it changed from 7.2 to cooker (ie. from 6 to 4 and > > back to 6). > > I believe you are right. This is a RedHat-ism it appears.
RedHat-ism *g* Anyway. The sourcecode in the linux version is 4 years old and the source-code from the author is from december 2001 and contains a few minor improvements which result in better code, the ability to specify other templates and the -t option that results is a direct use of the tempdirectory. All in all my recommendation is to upgrade to mktemp 1.4 after mdk 9.0 Groetjes, Han. -- http://www.xs4all.nl/~hanb/software