Newsgroups: comp.sys.next
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!phayes
From: phayes@magnus.acs.ohio-state.edu (Patrick W Hayes)
Subject: Automatic opening of compressed (.Z) files upon clicking
Message-ID: <1991Apr22.001539.9980@magnus.acs.ohio-state.edu>
Originator: phayes@left.magnus.ircc.ohio-state.edu
Sender: news@magnus.acs.ohio-state.edu
Nntp-Posting-Host: left.magnus.acs.ohio-state.edu
Organization: The Ohio State University
Date: Mon, 22 Apr 1991 00:15:39 GMT
Lines: 28

I wrote this little csh script to open files that end in .Z, not in Edit,
but rather what they would be opened in if they had been uncompressed:

zcat $1 > `basename $1 .Z`
open `basename $1 .Z`
rm `basename $1 .Z`

I call it zopen.  I'm new to csh scripts so I can't say its robust or anything,
but when I type for instance:

zopen Buzz12.ps.Z 

it opens the Buzz12 issue of the NeXT User's Journal automatically in Preview,
and zopen balls.tiff.Z will open balls.tiff in Icon, etc. without keeping the
uncompressed file around after I'm done.  Actually, I guess the uncompressed
version gets removed before I'm done reading it or looking at it or whatever,
but it doesn't seem to matter as (so far anyways) it's been read into a tmp
file upon opening.

So, what I want to know is, can I give a script an icon, and a document icon,
so that I can click on a .Z file from the browser and have it do the same thing
(without writing any code) ?

Or does 2.0 do this for you (I'm still on 1.0.)

Anyone have a better way to do this?

Patrick Hayes
