<?xml version="1.0" encoding="windows-1252"?>
<node id="191" title="perlfunc:binmode" created="1999-08-24 18:41:57" updated="2005-08-15 06:34:25">
<type id="119">
perlfunc</type>
<author id="114">
gods</author>
<data>
<field name="doctext">
</field>
<field name="name">

&lt;P&gt;
binmode - prepare binary files on old systems

&lt;P&gt;
&lt;HR&gt;
</field>
<field name="synopsis">

&lt;P&gt;
binmode 
&lt;FONT SIZE=-1&gt;FILEHANDLE&lt;/FONT&gt;

&lt;P&gt;
&lt;HR&gt;
</field>
<field name="description">

&lt;P&gt;
Arranges for the file to be read or written in ``binary'' mode in operating systems that distinguish between binary and text files. Files that are not in binary mode have 
&lt;FONT SIZE=-1&gt;CR&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;LF&lt;/FONT&gt; sequences translated to 
&lt;FONT SIZE=-1&gt;LF&lt;/FONT&gt; on input and 
&lt;FONT SIZE=-1&gt;LF&lt;/FONT&gt; translated to 
&lt;FONT SIZE=-1&gt;CR&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;LF&lt;/FONT&gt; on output. Binmode has no effect under Unix; in 
&lt;FONT SIZE=-1&gt;MS-DOS&lt;/FONT&gt; and similarly archaic systems, it may be imperative--otherwise your MS-DOS-damaged 
&lt;FONT SIZE=-1&gt;C&lt;/FONT&gt; library may mangle your file. The key distinction between systems that need
 [perlfunc:binmode|binmode()] and those that don't is their text file formats. Systems like Unix, MacOS, and Plan9 that delimit lines with a single character, and that encode that character in 
&lt;FONT SIZE=-1&gt;C&lt;/FONT&gt; as
 &lt;CODE&gt;&amp;quot;\n&amp;quot;&lt;/CODE&gt;, do not need
[perlfunc:binmode|binmode()]. The rest need it. If 
&lt;FONT SIZE=-1&gt;FILEHANDLE&lt;/FONT&gt; is an expression, the value is taken as the
name of the filehandle.

&lt;HR&gt;
</field>
</data>
</node>
