RR: write to tempfile