zopen archive
zopen filename


archivename::filename (? will break object path)
archivename%filename maybe.
[archivename]filename
(archivename)filename

%wish%Makefile
*wish*zipchan/note
%wish%zipchan/note
$wish$zipchan/note
#wish#zipchan/note
[wish]zipchan/note
{wish}zipchan/note
(wish)zipchan/note

[zlorp.exe]zipchan/note


<wish>zipchan/note <<<this one

two new channel types
ziparchive
 - read returns directory info
 - rewind resets directory pointer to the start...

zipfile
 - actual file interface
 - read
 - seek: will have to copy to memory.  Do this anyway?

zopen -archive filename
zopen filename <archivehandle>
"current archive"?  will simplify things quite a bit.

Reason for separate interface: quicker

hook in at:
 TclMatchFiles
 Tcl_OpenFileChannel
 ?


NEW idea:
 if Tcl_OpenFileChannel fails, try Z_OpenZipfileChannel with
  tclExecutableName as archive argument... heheheh.

Tcl_TranslateFilename?

To do:  globbing.  Rather important as much depends on it.

# need to work on "file ..." commands
# file readable,
# file exists,

Reasons for implementation:
 1) Generic zip file interface usable from Tcl.
    Should allow for all kinds of niceties, different ZIP archives open etc.
 2) Part of the packaging/distribution bit
    minimal, unobtrusive, transparent, reads only one ZIP archive - 
    [info nameofexecutable]

POA
 - get seek, tell etc. to work with zip archives (copy to memory, que sera)
 - replace TclMatchFiles, Tcl_OpenFileChannel (HACK THE CORE yay!)
 - test

 replace fopen and friends in csluc and cslush libraries with calls to
  Tcl_OpenFileChannel
 link and test.

use (needed ?)
Tcl_[SG]etAssocData
Tcl_DeleteAssocData
Tcl_GetChannelName
 

TODO:
 - add globbing support (needed for package mechanism to work!)
 - fixup TCL_LIBRARY and TK_LIBRARY initialisation routines - check the
    packaged executable (too? only?)


Fri Jul 10 22:13:38 PDT 1998
TODO
 - speed up globbing and general directory traversal?
   - store ZIP archive file listing in a linked list somewhere.
   - keep track of open ZIPs etc...
   - read once only?  how do we preserve it between calls to Z_OpenZipdir()
      and Z_CloseZipdir() ?
  Caching of unzFile descriptors is not worth the trouble - no 
  appreciable increase in access times (cool!)

 - CSLUc needs access to ZIP file, containers etc.
   - try to replace with Z_OpenZipchannel(...) ?
 - revisit packages (source pkgIndex.tcl files at startup?)
 - load {} foobar only if linked statically

Sun Jul 12 20:24:37 PDT 1998
Okay, works, give or take... Need to tweak init.tcl a bit, maybe.

XLoadBitmapFile or suchlike in Tk - no easy replacement with fopen.  Drat.
 -> replace bitmaps with gifs.
