Use tempnam instead of mktemp