From: Y.T. on
I'm trying to iterate through a directory (in TCL) and compress
certain files. In unix this would vaguely look like this

foreach i $filelist { exec gzip $i }

Except that I don't have gzip at my disposal in Windows XP. Which I
shouldn't need - windows can handle zipped files "magically": I double-
click a ".zip" file and it gets opened like a directory. I can copy
files into and out of the zipped directory. I never even have to think
about it. Which I'm guessing has to do with my C:\windows
\system32\zipfldr.dll

However I seem to be unable to make this happen from within TCL. I
can't "cd" into a zipped directory. I can vfs::zip::Mount it and I can
go into it nd I can read files there, but I can not put a new file
into it (which I'd need to do to zip the file).

My google-fu is failing me. Argh - am I getting too old? I am afraid
that the answer is totally obvious and I simply don't know where to
look .. :-(

Ideas anybody?

From: noone on

On Fri, 23 Jul 2010, Y.T. wrote:

> Date: Fri, 23 Jul 2010 20:26:45 -0700 (PDT)
> From: Y.T. <ytyourclothes(a)gmail.com>
> Newsgroups: comp.lang.tcl
> Subject: Compressing a file (in windows)
>
> I'm trying to iterate through a directory (in TCL) and compress
> certain files. In unix this would vaguely look like this
>
> foreach i $filelist { exec gzip $i }
>
> Except that I don't have gzip at my disposal in Windows XP. Which I
> shouldn't need - windows can handle zipped files "magically": I double-
> click a ".zip" file and it gets opened like a directory. I can copy
> files into and out of the zipped directory. I never even have to think
> about it. Which I'm guessing has to do with my C:\windows
> \system32\zipfldr.dll
>
> However I seem to be unable to make this happen from within TCL. I
> can't "cd" into a zipped directory. I can vfs::zip::Mount it and I can
> go into it nd I can read files there, but I can not put a new file
> into it (which I'd need to do to zip the file).
>
> My google-fu is failing me. Argh - am I getting too old? I am afraid
> that the answer is totally obvious and I simply don't know where to
> look .. :-(
>
> Ideas anybody?

Some years back, I wrote a tcl extension (in C) for libArchive. This
allowed access to various archive file formats, including tar, gzipped
tar, iso, cpio, pax and I believe (IIRC) .zip files. This ran on FreeBSD,
and Linux for sure, and seemed to cross compile on Windows OK, but
admittedly, I didn't exercise the Windows variant particularly strenuously
because back then the libArchive.dll was very difficult to build using the
MinGW32 compiler. You can reach me at rob at controlq dot com if you
would like to explore this option.

Cheers,
Rob.
From: edgar-rft on
Y.T. schrieb:
> I'm trying to iterate through a directory (in TCL) and compress
> certain files. In unix this would vaguely look like this
>
> foreach i $filelist { exec gzip $i }
>
> Except that I don't have gzip at my disposal in Windows XP. Which I
> shouldn't need - windows can handle zipped files "magically": I double-
> click a ".zip" file and it gets opened like a directory. I can copy
> files into and out of the zipped directory. I never even have to think
> about it. Which I'm guessing has to do with my C:\windows
> \system32\zipfldr.dll
>
> However I seem to be unable to make this happen from within TCL. I
> can't "cd" into a zipped directory. I can vfs::zip::Mount it and I can
> go into it nd I can read files there, but I can not put a new file
> into it (which I'd need to do to zip the file).
>
> My google-fu is failing me. Argh - am I getting too old? I am afraid
> that the answer is totally obvious and I simply don't know where to
> look .. :-(
>
> Ideas anybody?
>

Why not using a gzip Windows version, e.g. from:

http://unxutils.sourceforge.net/

and call it via Tcl 'exec' like shown in the Unix example above?
This way you can use exactly the same Tcl code with Unix/Linux
as well as with MS-Win.

- edgar


From: edgar-rft on
Y.T. schrieb:
> I'm trying to iterate through a directory (in TCL) and compress
> certain files. In unix this would vaguely look like this
>
> foreach i $filelist { exec gzip $i }
>
> Except that I don't have gzip at my disposal in Windows XP. Which I
> shouldn't need - windows can handle zipped files "magically": I double-
> click a ".zip" file and it gets opened like a directory. I can copy
> files into and out of the zipped directory. I never even have to think
> about it. Which I'm guessing has to do with my C:\windows
> \system32\zipfldr.dll
>
> However I seem to be unable to make this happen from within TCL. I
> can't "cd" into a zipped directory. I can vfs::zip::Mount it and I can
> go into it nd I can read files there, but I can not put a new file
> into it (which I'd need to do to zip the file).
>
> My google-fu is failing me. Argh - am I getting too old? I am afraid
> that the answer is totally obvious and I simply don't know where to
> look .. :-(
>
> Ideas anybody?
>

Why not using a gzip Windows version, e.g. from:

http://unxutils.sourceforge.net/

and call it via Tcl 'exec' like shown in the Unix example above?
This way you can use exactly the same Tcl code with Unix/Linux
as well as with MS-Win.

- edgar


From: edgar-rft on
Y.T. schrieb:
> I'm trying to iterate through a directory (in TCL) and compress
> certain files. In unix this would vaguely look like this
>
> foreach i $filelist { exec gzip $i }
>
> Except that I don't have gzip at my disposal in Windows XP. Which I
> shouldn't need - windows can handle zipped files "magically": I double-
> click a ".zip" file and it gets opened like a directory. I can copy
> files into and out of the zipped directory. I never even have to think
> about it. Which I'm guessing has to do with my C:\windows
> \system32\zipfldr.dll
>
> However I seem to be unable to make this happen from within TCL. I
> can't "cd" into a zipped directory. I can vfs::zip::Mount it and I can
> go into it nd I can read files there, but I can not put a new file
> into it (which I'd need to do to zip the file).
>
> My google-fu is failing me. Argh - am I getting too old? I am afraid
> that the answer is totally obvious and I simply don't know where to
> look .. :-(
>
> Ideas anybody?
>

Why not using a gzip Windows version, e.g. from:

http://unxutils.sourceforge.net/

and call it via Tcl 'exec' like shown in the Unix example above?
This way you can use exactly the same Tcl code with Unix/Linux
as well as with MS-Win.

- edgar