Thanks Mac, works like a charm. Thanks for your efforts everybody else. On Mar 11, 12:44 ¨Âí¬ Ðáõì Íãëéââéî ¼ðíãëéâ®®®Àçíáéì®ãïí÷òïôåº > Daniel Brumbaugh Keeney wrote: > > On Mon, Mar 10, 2008 at 7:01 PM, Daniel Brumbaugh Keeney > > <devi.webmas... / gmail.com> wrote: > >> ¨Âçú Úìé⺺ÇúéðÒåáäåò®îå÷¨Æéìå®ïðåôåóô®ôçú§¬ §òâ§©© > >> Warning: tgz and the file will be closed. > > > I seem to have failed to remove the former comment. It looks like > > Minitar::Reader at no point closes tgz or the file, and therefore tgz > > needs to be closed manually afterward, as I my code correctly > > demonstrated, though the comment did not. > > > Daniel Brumbaugh Keeney > > You can use Zlib::GzipReader.open with a block. (Since I set Chris the > original problem, and this isn't the hard part, I'll show the code that > is used in the app, with a couple of minor mods to make it look like > Chris's example.) > > Zlib::GzipReader.open(@tarfile) { |tgz| > Archive::Tar::Minitar::Reader.open(tgz).each do |entry| > > # Chris's code > # ¨Âðì ÓôòéîçÉÏ®îå÷åîôòù®òåáäéæ åîôòù®îáíå ½þ > /#{@date}#{channel}_pl/ > # ¨Âðé ÓôòéîçÉÏ®îå÷åîôòù®òåáäéæ åîôòù®îáíå ½þ > /#{@date}#{channel}_pi/ > > # Or test the verification by using the XML document directly > # fpl=REXML::Document.new(StringIO.new(entry.read)) if entry.name > =~/#{date}#{channel}_pl/ > # fpi=REXML::Document.new(StringIO.new(entry.read)) if entry.name > =~/#{date}#{channel}_pi/ > > end > > } > > Mac > -- > Posted viahttp://www.ruby-forum.com/.