From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 636581F466 for ; Fri, 17 Jan 2020 14:18:08 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8DCEE1209FB; Fri, 17 Jan 2020 23:17:47 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 871441209E7 for ; Fri, 17 Jan 2020 23:17:45 +0900 (JST) Received: by filterdrecv-p3las1-5bf99c48d-fkthr with SMTP id filterdrecv-p3las1-5bf99c48d-fkthr-20-5E21C209-4E 2020-01-17 14:17:45.821033536 +0000 UTC m=+2727125.139779084 Received: from herokuapp.com (unknown [3.89.197.5]) by ismtpd0013p1iad2.sendgrid.net (SG) with ESMTP id SLI4HNzETESn-n1HcFq_9A for ; Fri, 17 Jan 2020 14:17:45.696 +0000 (UTC) Date: Fri, 17 Jan 2020 14:17:45 +0000 (UTC) From: daniel@dan42.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72590 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 9790 X-Redmine-Issue-Author: quainjn X-Redmine-Issue-Assignee: drbrain X-Redmine-Sender: Dan0042 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?8sy4RigFvRTdBfCVJrT9zb2J88PC92TMQwdNgaWYaq7UasfgRhbu9v=2FztxQ2UN?= =?us-ascii?Q?kssgT=2FDXxvyZ7Ce1CrNyYfKdZObvbboECBnATY6?= =?us-ascii?Q?V43nY0LS=2FEfMrjKc=2FKCIXBoWGoGlC6dQ=2FoMZcSV?= =?us-ascii?Q?ymB=2FbXc1PF091TuZSRAFKS+QnUyF2pAAfhFH5YE?= =?us-ascii?Q?tMuZVjFvi4Uqz9EZFPclL=2Fh8vR7gNibLLEsDmcN?= =?us-ascii?Q?l9f4iznm3Jm2wGbVU=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96927 Subject: [ruby-core:96927] [Ruby master Bug#9790] Zlib::GzipReader only decompressed the first of concatenated files X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #9790 has been updated by Dan0042 (Daniel DeLorme). I can't think of taking a random member but I can imagine wanting to extract to separate files. ```ruby Zlib::GzipReader.each_file(filename).with_index do |gzip,i| File.open("output#{i}","w"){ |f| f.write(gzip.read) } end ``` But I admit I haven't needed this personally, so maybe this is not so useful. ---------------------------------------- Bug #9790: Zlib::GzipReader only decompressed the first of concatenated files https://bugs.ruby-lang.org/issues/9790#change-83950 * Author: quainjn (Jake Quain) * Status: Feedback * Priority: Normal * Assignee: drbrain (Eric Hodel) * Target version: * ruby -v: 2.1.1 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- There is a similar old issue in Node that I came across that perfectly describes the situation in ruby: https://github.com/joyent/node/issues/6032 In ruby given the following setup: ``` echo "1" > 1.txt echo "2" > 2.txt gzip 1.txt gzip 2.txt cat 1.txt.gz 2.txt.gz > 3.txt.gz ``` Calling: ``` Zlib::GzipReader.open("3.txt.gz") do |gz| print gz.read end ``` would just print: ``` 1 ``` ---Files-------------------------------- zlib-gzreader-each_file-9790.patch (3.47 KB) -- https://bugs.ruby-lang.org/