Thanks a lot for you answer, gzwrite is interesting :
open FFF, "<fu.txt" or die "$!" ;
binmode FFF ;
$gz = gzopen("fu.txt.gz", "wb") or die "gzerror" ;
while ($buffer = <FFF>) { $gz->gzwrite($buffer) }
close FFF ;
$gz -> gzclose ;
The resulting file is a valid gz file.
I have to point out that i'm under win32, hence the binmode (otherwise newlines are washed out when i uncompress the file). But, i have a problem here : what i need to obtain is a .Z file and not a .gz . This might not be mandatory, but the resulting file is sent to someone else and i'll have to check if his programs can deal with a .gz . Do you know if Compress::Zlib will allow me to create a .Z file ? For exemple with inflate / deflate ? Or is zlib for gz compression only ? Thanks a lot, ZlR .
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|