[Tutor] ftp file size puzle

Pijus Virketis virketis@post.harvard.edu
Wed, 26 Jun 2002 21:34:41 +0300


<HTML><HEAD>
<BASEFONT FACE=3D"Arial" SIZE=3D"2" COLOR=3D"#000000">
</HEAD>
<BODY>
<div>Danny,<br></div>
<div><br>
<FONT COLOR=3D"#000080">&gt;There's one fix you'll want to make:=
 you'll want to open the file in</FONT><br>
<FONT COLOR=3D"#000080">&gt;binary mode:</FONT><br>
<FONT COLOR=3D"#000080">&gt;</FONT><br>
<FONT COLOR=3D"#000080">&gt;file =3D open(&quot;some_file_name&quot;,=
 &quot;b&quot;)</FONT><br>
<br>
Your suggestion was right on! One little detail. It seems that in=
 order to open up a file in binary, the modifier should actually=
 be &quot;rb&quot; or &quot;wb&quot;, because &quot;b&quot; on=
 its own gives an IOError in P2.2.1. Just in case someone else=
 wants to try this at home. :)<br></div>
<div>&nbsp;</div>
<div>Thanks for a quick reply, <br></div>
<div>&nbsp;</div>
<div>Pijus<br></div>
<div>&nbsp;</div>
<div>-- <br></div>
<div>&quot;Anyone attempting to generate random numbers by=
 deterministic means is, of course, living in a state of=
 sin.&quot; -- John Von Neumann<br></div>
</body></html>