use msmktempfile instead of raw mktemp -- should be more portable