<?xml version="1.0" encoding="windows-1252"?>
<node id="670426" title="Re^3: Temporary text files with File::Temp" created="2008-02-26 18:01:11" updated="2008-02-26 13:01:11">
<type id="11">
note</type>
<author id="125487">
jarich</author>
<data>
<field name="doctext">
&lt;p&gt;
We teach binmode, for use when we expect the file to be binary.  If there were a layer I could pass to binmode which turned off binary, or turned everything back to text processing (text/reset/default/native) which didn't require another module to do it, I'd be thrilled.  Unfortunately this doesn't seem to be the case.
&lt;/p&gt;
&lt;p&gt;
I don't mind teaching my students that File::Temp assumes that temporary files will be binary by default.  I was just hoping that someone could show me the easy, portable way we could revert that.  But it doesn't seem to exist in Perl 5.10 and below.  Perhaps I'll get a patch into File::Temp for 5.10.1, or alternately have some luck getting a layer for binmode which turns off binary.
&lt;/p&gt;
&lt;p&gt;
Unfortunately in-memory files isn't really what I was looking for.  They're cool, but they don't really solve the problem I was having.  I want to be able to write out a file to a temporary location, then when I know that it's been fully written, I want to move the file over an original atomically.  This means that at no point can someone access that file and get invalid data.  Old previously-valid data, sure, but never only partly-written data.
&lt;/p&gt;
&lt;p&gt;
thanks, jarich.
&lt;/p&gt;</field>
<field name="root_node">
670208</field>
<field name="parent_node">
670259</field>
</data>
</node>
