convert tmpnam to mkstemp
