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.
Blue skies... Todd
--
| MandrakeSoft USA | Sometimes you get what you want. |
| http://www.mandrakesoft.com | Sometimes you get experience. |
| http://www.mandrakelinux.com | --unknown origin |
msg72969/pgp00000.pgp
Description: PGP signature
