From: music Date: 2007-04-24T17:15:06+09:00 Subject: Re: unix zcat with ruby? Robert Dober wrote: > On 4/24/07, music wrote: >> Robert Dober wrote: >> > On 4/24/07, music wrote: >> >> Robert Dober wrote: >> >> > On 4/23/07, music wrote: >> >> >> I have to read in many files. >> >> >> I prefer to concat those files and reading only one large file. >> >> >> There is a way like unix zcat? >> >> >> >> >> >> >> >> > Sure is >> >> > ARGF >> >> >> >> ARGF ok, but how can I pass ARGF to a method? >> >> >> >> >> > As a global constant it is visible anywhere, you can thus simply do >> > things like this >> > >> > def my_method >> > ARGF.each_line do >> > | line | >> > whatever >> > end >> > end >> >> Great!!! and if input files are in gzip format? how can I read them? >> >> > http://www.ruby-doc.org/stdlib/libdoc/zlib/rdoc/index.html > Yes but can I use ARGF with zlib?