Subject: doing .zip like .tar on the fly?

From: Albert Lunde <[email-masked]>
Date: Mon, 10 Feb 1997 16:25:14 -0600

I'd like to use the Unix zip programs to archive directories (and/or files)
in a fashion similar to that support for tar. After looking over some of
the source and documentation I can decide if this should require source
mods or just a line or two in ftpconversions.

Has anyone done this, or can you offer advice one way or the other?

---
    Albert Lunde                      [email-masked]

---

From: Alain Magloire <[email-masked]>
Date: Mon, 10 Feb 1997 18:49:09 -0500 (EST)

> Has anyone done this, or can you offer advice one way or the other?

if you browse to the archive, you'll find
plenty of examples, it was a 'hot' topic last year.

You just need to modify ftpconversion and have a version
of zip that can do stuff on the fly.

-- 
Bonne anne'e, alain

---

From: [email-masked] (Keith Iverson)
Date: Mon, 10 Feb 1997 16:30:53 -0800 (PST)

>I'd like to use the Unix zip programs to archive directories (and/or
files) >in a fashion similar to that support for tar. After looking over
I'd like to use the Unix zip programs to archive directories (and/or files)
>    Albert Lunde                      [email-masked]

Works great with just a simple addition to the 'ftpconversions' file. 
Also make sure that you have the latest version of '(un)zip' (unzip 5.12
zip 2.1) which can handle accepting filenames from STDIN.  Below is the
'ftpconversions' file that works for me on SunOs 4.1.3. 

 :.Z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :   : :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
 :.gz: :  :/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
 :   : :.gz:/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP
 :.zip: : :/bin/unzip  -qq -p %s:T_REG|T_ASCII:O_UNCOMPRESS:UNZIP
 : : :.zip:/bin/zip -qq - %s:T_REG:O_COMPRESS:ZIP

Keith A. Iverson        Iverson Financial Systems, Inc.
E-mail - [email-masked]
<======================================================>

---

From: Shane Castle <[email-masked]>
Date: Tue, 11 Feb 1997 07:31:11 -0700 (MST)

>Has anyone done this, or can you offer advice one way or the other?

I had to use gnu tar in order to get tarred and compressed output.  I
am using the info-zip package for Unix for .zip files, the installed
compress command for .Z, and gnuzip for .gz.  In order to get the
info-zip package to work for anonymous ftp I had to add libbsd.a to the
~ftp/lib directory.  (This system is AIX 3.2.5.1.)

This had been tested using a pure-DOS FTP client and the info-zip
components work just fine, zipping and unzipping "on the fly".
(No, that was not originally intended as a double-entendre.)

Here is my ftpconversions file:

#strip prefix:strip postfix:addon prefix:addon postfix:external command:
#types:options:description
 :.Z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :.z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :.gz:  :  :/bin/gzip -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :.zip:  :  :/bin/unzip -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :  :  :.zip:/bin/zip -q - %s:T_REG:O_COMPRESS:COMPRESS
 :  :  :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
 :  :  :.gz:/bin/gzip -c %s:T_REG:O_COMPRESS:COMPRESS
 :  :  :.tar:/bin/gtar -c -f - %s:T_REG|T_DIR:O_TAR:TAR
 :  :  :.tar.Z:/bin/gtar -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
 :  :  :.tar.gz:/bin/gtar -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS

Shane Castle             | "Perfection, then, is finally achieved, not
Boulder County Info Svcs | when there is nothing left to add, but when
Boulder CO USA           | there is nothing left to take away."
                         |                - Antoine de Saint-Exupery

---

From: Jim Simmons <[email-masked]>
Date: 14 Feb 1997 16:02:44 -0000

I changed the zip line slightly so you can zip up entire directories
(like .tar.gz) and it looks like it works fine:

 :.zip: : :/bin/unzip  -qq -p %s:T_REG|T_ASCII:O_UNCOMPRESS:UNZIP
 : : :.zip:/bin/zip -qq -r - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:ZIP

The recursive flag (-r) doesn't cause any problems if the argument is
a regular file, so this works.  Or at least it did for me on a Solaris
2.4 system with beta-12.

Jim