[Octopus-users] mktemp -d [default] usage (was: testsuite script)

Axel Thimm Axel.Thimm at physik.fu-berlin.de
Wed Mar 8 08:57:03 WET 2006


Hi Francesco,

On Tue, Mar 07, 2006 at 04:43:34PM +0100, Francesco Sottile wrote:
> On Tue, 7 Mar 2006, Heiko Appel wrote:
> >On Tue, Mar 07, 2006 at 03:19:56PM +0100, Francesco Sottile wrote:
> >>
> >>sorry for not being clear.
> >>The testsuite perl script relies on the creation of a temporary directory.
> >>The latter is created via the command
> >>'mktemp -d'
> >>The way how mktemp works is:
> >>mktemp [-d] [directory]
> >>As far as I understood in you version of mktemp, if [directory]
> >>is not given it will create a new one.
> >>However this is not the standard use of mktemp.
> >>In my machine, for example (but I also found this way on opteron machine,
> >>or compaq with tru64) the [directory] is a mandatory field. Result:
> >>'mktemp -d' won't work and so the testsuite script.
> >>maybe the solution could be to put
> >>mktemp -d /tmp/octopus.XXXXXX
> >>in this way the mktemp will substitute the XXXXXX with a unique
> >>combination
> >
> >thanks for the response. Now I understand the issue :). I just
> >had Linux systems around when I wrote the Perl script. At least
> >on Debian, Fedora Core and SuSE the -d flag is documented in the
> >man page as
> >
> >-d     Make a directory instead of a file.
> >
> >i.e. without additional directory name (I just checked this).
> >
> >Since your suggestion: mktemp -d /tmp/octopus.XXXXXX seems to work
> >on True64 and Linux at the same time, I'll change the testsuite
> >script in the cvs accordingly.
> >
> >What OS was the Opteron box running (obviously not one of the three
> >Linux distros from above, since there the -d option without argument
> >is working)?
> 
> Red Hat Enterprise Linux Kernel 2.4.21-20.ELsmp
> f.

That's RHEL3 or a clone (but missing updates from at least since
autumn/winter 2004). I checked on an updated RHEL3 system and mktemp
-d does the right thing:

# mktemp -d
/tmp/tmp.hzFyP26527
# ls -l /tmp
total 4
drwx------    2 root     root         4096 Mar  8 03:42 tmp.hzFyP26527

But RHEL3's predecessor, RH9, for instance does not support a default
argument, and scientific community has often stayed with RH's golden
7.3 release. At least the -d flag is always supported.

I also agree that passing an argument is a good idea anyways, since
stale tmp.XXXXXXX directories from broken testsuite runs are not
self-explaining, /tmp/octopus-test-XXXXXXX or similar would help
admins clean up their /tmp.
-- 
Axel.Thimm at physik.fu-berlin.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://www.tddft.org/pipermail/octopus-users/attachments/20060308/152f3d8d/attachment.bin


More information about the Octopus-users mailing list