[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



I have created a 9M file that is the output of my program.  How do I
reassemble this in perl.  Do I need to read it all into a buffer and
feed it to the decoder after I strip the NL's off?

On the perl side I'm simply just using it to test my XML-RPC C code on
my embedded device.  The reason I have a 9m file is that I intend to
feed software upgrades via XML-RPC.

On Mon, 2005-02-14 at 12:03, Fletch wrote:
> >>>>> "Christopher" == Christopher Fowler <cfowler at outpostsentinel.com> writes:
> 
>     Christopher> I'm trying to use MIME::Base64::encode to encode a 9m
>     Christopher> binary file into Base64.  I'm using sysopen and
>     Christopher> sysread on the file but I'm not sure how to append
>     Christopher> the result of the read into a data buffer.
> 
> If you check down in the "EXAMPLES" section of "perldoc MIME::Base64"
> it says you should just read and encode using a multiple of 57 bytes
> to completely fill up a single base64 line:
> 
>           use MIME::Base64 qw(encode_base64);
> 
>           open(FILE, "/var/log/wtmp") or die "$!";
>           while (read(FILE, $buf, 60*57)) {
>               print encode_base64($buf);
>           }


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00531" href="msg00531.html">[ale] Base64 encoding in Perl</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00524" href="msg00524.html">[ale] Base64 encoding in Perl</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
<li><strong><a name="00526" href="msg00526.html">[ale] Base64 encoding in Perl</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00527.html">[ale] Re: speedfactory dsl router setup</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00529.html">[ale] Re: speedfactory dsl router setup</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00526.html">[ale] Base64 encoding in Perl</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00531.html">[ale] Base64 encoding in Perl</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00528"><strong>Date</strong></a></li>
<li><a href="threads.html#00528"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>