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!
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 Korrapati
http://vikhyat.net/
On Mon, Jun 13, 2011 at 9:30 PM, medarkness arkness <rotakinrof@hotmail.com> 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!
Hi,
I'm new on the block (mailing list & ruby).
Welcome ![]()
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 ![]()
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 13.06.2011 18:00, medarkness arkness wrote:
And yes, this mailing list is used to ask any kind of question related to Ruby.
Welcome !
Jesus.
On Mon, Jun 13, 2011 at 6:00 PM, medarkness arkness <rotakinrof@hotmail.com> wrote:
2) does this mailing list used to ask those kind of questions?
perfect, thanks
Date: Tue, 14 Jun 2011 01:09:32 +0900
From: vikhyatk@gmail.com
Subject: Re: Hi rubies
To: ruby-talk@ruby-lang.orgOn Mon, Jun 13, 2011 at 9:30 PM, medarkness arkness > <rotakinrof@hotmail.com> 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 Korrapati
http://vikhyat.net/