From: Brian Candler Date: 2003-07-01T05:29:11+09:00 Subject: Re: Zlib On Tue, Jul 01, 2003 at 01:45:14AM +0900, Andreas Schrafl wrote: > I want to compress a some files in a directory and move them to one > file. It is for a database and the compression type is zip. so now what > I don't know is how to zip more than one file. what is the seperator of > a file in zip? Are you sure you mean 'zip' files and not 'gzip' files? They are very different. 'zip' files are multi-component archives (originating from the DOS world as 'pkzip'). I didn't think that ruby-zlib could create them. 'gzip' compresses a single stream. It is possible to concatenate several gzip files just by putting them one after the other, but when you decompress it you'll just back a single stream. It's up to you to put your own demarcation between files, gzip just sees it all as a stream of bytes. < as I can input more a stream of a file (string) it is > easy to zip one file but several? I found a way but that is by bypassing > the command to the console and execute tar. this is not a nice way and I > want to avoid it if possible. 'tar', 'cpio' and 'zip' are three separate command-line tools which generate three different types of multi-file archive. I think that if you already have several files in a directory, then calling one of these external programs is the easiest way to create one of these archives. I notice in RAA a module 'tarsimple' which can generate tar files, but I think it just calls the external command anyway. Cheers, Brian.