[Starkit] Improving Tcl compression and performance

Jean-Claude Wippler jcw at equi4.com
Sun Jan 11 23:06:49 CET 2004


Guaca Mole wrote:

> The problem with tar file is that I
> would require 3 times the space: One for the Tclkit,
> one for extracting the tar to the filesystem and one
> for extracting the contents. Unless it is possible to
> layer VFS inside each other (open a vfs::tar file
> inside mk4vfs::vfs) ?

Open VFS tar/gz file, open a pipe to tar/gz, and fcopy.  No temp space 
at all.

Or save as tar and let starkit do the compression (slower, as you 
mentioned), then do the above.  Same effect, and if you want to totally 
get rid of outside dependencies you could even do the 
tar-decode-and-unpack-to-files in Tcl.  FWIW, SDX has a "tgz2sdx" 
sub-command, which contains all the essential logic to decode TAR files 
in Tcl, so it should be simple to re-use some of that.

Summary: if you let the VFS layer decompress, you could have your TAR 
inside the starkit, compressed as a single file (i.e. better than ZIP), 
and you could decompress through the normal starkit mechanism and 
extract files, all from Tcl, no external applications, 100% portable.

Or look at the zlib extension (see http://www.equi4.com/critlib/ for a 
Critcl version), and redo it with bzip2.  Should be very easy, since 
the API's of the two are very similar.

There's no rocket science in any of these approaches.  It just takes 
some elbow grease.

-jcw



More information about the Starkit mailing list