Forum: Ruby system call using gzip or using rubyzip?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F6a3dfee23741adec521eff5fa003aa0?d=identicon&s=25 Derek Smith (derekbsmith)
on 2009-04-16 04:32
How do I duplicate this gzip -f call in Ruby?

require 'rubygems'
require 'zip/zip'
require 'ftools'

File.makedirs("devlogs_zipped") \
    or raise StandardError, "Make dir failed to

if ( array1.length >= 1 )

    array1.each { |file|
        if (File.size?(file) > FSIZE)
            File.copy(file, "#{file}.#{countr}")
            `gzip -f

I played with this code below, but its not what I want, which is to
create a dir called devlogs_zipped, then move all dev* logs to the
devlogs_zipped dir, then compress all dev* logs."", Zip::ZipFile::CREATE) {
    zipfile.get_output_stream("first.txt") { |f| f.puts "Hello from
ZipFile" }

thank you
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2009-04-16 09:18
Derek Smith wrote:
> How do I duplicate this gzip -f call in Ruby?

To gzip individual files, try using zlib (included as a standard
This topic is locked and can not be replied to.