I'll move it /tmp if that is the proper solution according to you. It seemed more clear to have something that is created and deleted on a controlled way than writing stuff into tmp (which might point to surprising places in windows).
And tmpnam should not be used, it is dangerous. mkstemp should be used instead.