Thanks, Gavin. I’m onto something here. I found rubyzip, which will do
what I need it to. However, I’m having a bit of trouble tracking down how
to use it properly. Any ideas?
Craig
I would like to add or move a file to a pre-existing gzipped file. Nobu
tipped me off to the fact that Ruby has built in zlib methods. I can’t,
however, find any good examples of what I want to do. Specifically, I’d
like to move all *.log files in a directory to a file named Archived.gz.
Help please?
Kindest Regards-
Craig
I’d love to say I knew how, but I don’t. If you take a look at
http://www.ruby-doc.org/stdlib/libdoc/zlib/rdoc/index.html
you can see what classes and methods are implemented. With
experimentation, you’ll probably get somewhere.
Ooops, just looked and saw that there is some documentation alongside
the source code: ext/zlib/doc/zlib.rd. That means it’s probably on
the web somewhere; try Google.
Any volunteers for converting this RD documentation into RDoc format
inside the source code?
Cheers,
Gavin
PS. GZip compresses single files, unlike ZIP, which creates compressed
archives. So getting a bunch of files into a .gz file is not feasible
without using TAR. I don’t know how people might go about creating
compressed archives with Ruby. I use: system(“tar zcvf …”)
···
From: Gavin Sinclair [mailto:gsinclair@soyabean.com.au]
On Thursday, February 19, 2004, 12:24:40 AM, Craig wrote: