Discussion:
Unzip a zip file containing multiple files and folders
(too old to reply)
Shaun Kulesa
2023-04-16 19:05:57 UTC
Permalink
I have a .zip file that contains folders which have files and other folders that contain files and folders and so on...

It's a zipped version of the tcl directory if that makes it more clear.

How can I unzip all of these into a directory?
Robert Heller
2023-04-16 19:59:36 UTC
Permalink
Post by Shaun Kulesa
I have a .zip file that contains folders which have files and other folders that contain files and folders and so on...
It's a zipped version of the tcl directory if that makes it more clear.
How can I unzip all of these into a directory?
The "unzip" command will unzip the whole tree as it is stored in the .zip
file, restoring the stored directories ("folders" -- a really stupid bit of
terminology, thank you Steve Jobs) and the files in those directories in the
restored directories, and so on all the way down the directory tree. Or do you
want something else? The unzip command also has a -d option to change the top
level directory to restore to, if you want to restore the files to a different
directory (something other than the current default directory.

At least this is how things work under Posix O/Ss (BSD Unix and Linux, etc.)
from the command line. Don't know about how that work under a GUI. There are
VFS packages to allow the Tcl program to open a .zip file as a VFS -- eg
"mount" a .zip file like it was a "disk" and then use Tcl's FS functions (file
command and source, open, read/gets, puts, fconfigure, close, etc. commands)
to access files in the .zip file.
--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services
Shaun Kulesa
2023-04-16 20:43:16 UTC
Permalink
"Don't know about how that work under a GUI. There are
VFS packages to allow the Tcl program to open a .zip file as a VFS -- eg
"mount" a .zip file like it was a "disk" and then use Tcl's FS functions (file
command and source, open, read/gets, puts, fconfigure, close, etc. commands)
to access files in the .zip file."

This is what I was afraid of, I will implement this later on but for now I have just made a windows batch script that I will call from Tcl to unzip the zipped file.
Luc
2023-04-16 20:57:14 UTC
Permalink
Are you aware of Tcllib?

https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/toc.md

More specifically:

https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/zip/decode.md
--
Luc
Loading...