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.
Derek S. (Guest)
on 2009-04-16 06: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
Brian C. (Guest)
on 2009-04-16 11:18
Derek S. 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.