Hi rubies

I’m new on the block (mailing list & ruby).
I have some questions:

  1. I’m trying to compress a file using gzip, which library is more
    suitable for this?
  2. does this mailing list used to ask those kind of questions?

thanks!

On Mon, Jun 13, 2011 at 9:30 PM, medarkness arkness
[email protected] wrote:

I’m new on the block (mailing list & ruby).
I have some questions:

  1. I’m trying to compress a file using gzip, which library is more suitable for
    this?
  2. does this mailing list used to ask those kind of questions?

thanks!

Does `zlib’ meet your requirements?

Vikhyat K.
http://vikhyat.net/

perfect, thanks

Content preview: Hi, On 13.06.2011 18:00, medarkness arkness wrote: >
I’m new
on the block (mailing list & ruby). Welcome :slight_smile: […]

Content analysis details: (-2.9 points, 5.0 required)

pts rule name description



-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
X-Cloudmark-Analysis: v=1.1
cv=HQ3F56nxkum+cgCiDL7AXQpbvw7DWrWCBJRnYYnM0Zc= c=1 sm=0
a=xh2vM6_GbZgA:10 a=IkcTkHD0fZMA:10 a=CH-RE0sgAAAA:8
a=VDC5OMNUxtqmYJuew2cA:9 a=QEXdDO2ut3YA:10
a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
Lines: 31
List-Id: ruby-talk.ruby-lang.org
List-Software: fml [fml 4.0.3 release (20011202/4.0.3)]
List-Post: mailto:[email protected]
List-Owner: mailto:[email protected]
List-Help: mailto:[email protected]?body=help
List-Unsubscribe: mailto:[email protected]?body=unsubscribe
Received-SPF: none (Address does not pass the Sender Policy Framework)
SPF=FROM;
[email protected];
remoteip=::ffff:221.186.184.68;
remotehost=carbon.ruby-lang.org;
helo=carbon.ruby-lang.org;
receiver=eq4.andreas-s.net;

Hi,

On 13.06.2011 18:00, medarkness arkness wrote:

I’m new on the block (mailing list & ruby).

Welcome :slight_smile:

I have some questions:

  1. I’m trying to compress a file using gzip, which library is more suitable for
    this?

I think you will be fine with the zlib library, see
http://www.ruby-doc.org/stdlib/libdoc/zlib/rdoc/index.html for
documentation.

Here’s a short example using irb:

$ irb
Welcome to IRB. You are using ruby 1.9.2p180 (2011-02-18) [i686-linux].
Have fun :wink:

open(‘test.txt’).read #=> “This is a simple test\n”
require ‘zlib’ #=> true
Zlib::GzipWriter.open(‘test.txt.gz’) { |gz| gz.write
open(‘test.txt’).read } #=> 22

open(‘test.txt.gz’).read
=>
“\u001F\x8B\b\u0000\x827\xF6M\u0000\u0003\v\xC9\xC8,V\u0000\xA2D\x85\xE2\xCC܂\x9CT\x85\x92\xD4\xE2\u0012.\u0000\x84\xC1\u0012F\u0016\u0000\u0000\u0000”

Zlib::GzipReader.open(‘test.txt.gz’).read #=> “This is a simple test\n”

cheers,

  • Markus

On Mon, Jun 13, 2011 at 6:00 PM, medarkness arkness
[email protected] wrote:

  1. does this mailing list used to ask those kind of questions?

And yes, this mailing list is used to ask any kind of question related
to Ruby.

Welcome !

Jesus.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs