Tcl Source Code

Check-in [d97273f74c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:resolution of ticket [7db9574a06]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | zipfs-consolidation
Files: files | file ages | folders
SHA3-256: d97273f74c2dfecc9ccb7f7673f3afdbd114d71b656e6c974b6e8b29e78c349d
User & Date: Torsten 2024-08-06 06:20:44.516
References
2024-08-06
06:22 Ticket [7db9574a06] Undocumented features of zipfs implementation status still Open with 3 other changes artifact: e06bdc2f0f user: tberg
Context
2024-08-06
06:36
resolution of ticket [75291b89b3] check-in: 6a6dac423f user: Torsten tags: zipfs-consolidation
06:20
resolution of ticket [7db9574a06] check-in: d97273f74c user: Torsten tags: zipfs-consolidation
2024-08-05
22:59
also change zipfs.3 to match the resolution of ticket [b9f3ff8fe6] check-in: e49d28592d user: Torsten tags: zipfs-consolidation
Changes
Unified Diff Ignore Whitespace Patch
Changes to doc/tclsh.1.
157
158
159
160
161
162
163
164
165
166
167
168




169
170
171
172
173
174
175
.PP
See \fBTcl_StandardChannels\fR for more explanations.
.SH ZIPVFS
.PP
When a zipfile is concatenated to the end of a \fBtclsh\fR, on startup
the contents of the zip archive will be mounted under a virtual file
system (VFS). The root of that VFS can be retrieved using the \fBzipfs root\fR
command. If a top level directory \fBtcl_library\fR is
present in the zip archive, it will become the directory loaded as
env(TCL_LIBRARY). If a file named \fBmain.tcl\fR is present in the top
level directory of the zip archive, it will be sourced instead of the
shell's normal command line handing.




.PP
Only one zipfile can be concatenated to the end of executable image
(tclsh, or wish). However, if multiple zipfiles are
concatenated, only the last one is used.

This filesystem is read-only. Files cannot be added or modified within
this mounted file system.  See zipfs(n) for complete details.







<
|
|

|
>
>
>
>







157
158
159
160
161
162
163

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
.PP
See \fBTcl_StandardChannels\fR for more explanations.
.SH ZIPVFS
.PP
When a zipfile is concatenated to the end of a \fBtclsh\fR, on startup
the contents of the zip archive will be mounted under a virtual file
system (VFS). The root of that VFS can be retrieved using the \fBzipfs root\fR

command. The zip archive is mounted under the \fBapp\fR directory within the
VFS. If a file named \fBmain.tcl\fR is present in the top
level directory of the zip archive, it will be sourced instead of the
shell's normal command line handing. If a top level directory \fBtcl_library\fR is
present in the zip archive, it will become the directory loaded as
env(TCL_LIBRARY). If the file \fBtcl_library/init.tcl\fR is present in the zip
archive, the \fBtcl_library\fR global variable in the initial Tcl interpreter
is set to \fBapp/tcl_library\fR.
.PP
Only one zipfile can be concatenated to the end of executable image
(tclsh, or wish). However, if multiple zipfiles are
concatenated, only the last one is used.

This filesystem is read-only. Files cannot be added or modified within
this mounted file system.  See zipfs(n) for complete details.
Changes to doc/zipfs.n.
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35
36
37
38
39
.SH SYNOPSIS
.nf
\fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIZIPFS\fR?
\fBzipfs exists\fI filename\fR
\fBzipfs find\fI directoryName\fR
\fBzipfs info\fI filename\fR
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? ?\fIpattern\fR?
\fBzipfs lmkimg\fI outfile inlist\fR ?\fIpassword infile\fR?
\fBzipfs lmkzip\fI outfile inlist\fR ?\fIpassword\fR?
\fBzipfs mkimg\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
\fBzipfs mkkey\fI password\fR
\fBzipfs mkzip\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
\fBzipfs mount\fR ?\fIzipfile\fR? ?\fImountpoint\fR? ?\fIpassword\fR?

\fBzipfs root\fR
\fBzipfs unmount\fI mountpoint\fR
.fi
'\" The following subcommand is *UNDOCUMENTED*
'\" \fBzipfs mountdata\fR ?\fIdata\fR ?\fImountpoint\fR??
.BE
.SH DESCRIPTION
.PP
The \fBzipfs\fR command provides Tcl with the ability to mount the
contents of a ZIP archive file as a virtual file system. Tcl's ZIP
archive support is limited to basic features and options.
Supported storage methods include only STORE and DEFLATE with optional







|





>



<
<







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


32
33
34
35
36
37
38
.SH SYNOPSIS
.nf
\fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIZIPFS\fR?
\fBzipfs exists\fI filename\fR
\fBzipfs find\fI directoryName\fR
\fBzipfs info\fI filename\fR
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? ?\fIpattern\fR?
\fBzipfs lmkimg\fI outfile inlist\fR ?\fIpassword\fR? ?\fIinfile\fR?
\fBzipfs lmkzip\fI outfile inlist\fR ?\fIpassword\fR?
\fBzipfs mkimg\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
\fBzipfs mkkey\fI password\fR
\fBzipfs mkzip\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
\fBzipfs mount\fR ?\fIzipfile\fR? ?\fImountpoint\fR? ?\fIpassword\fR?
\fBzipfs mountdata\fR \fIdata\fR \fImountpoint\fR
\fBzipfs root\fR
\fBzipfs unmount\fI mountpoint\fR
.fi


.BE
.SH DESCRIPTION
.PP
The \fBzipfs\fR command provides Tcl with the ability to mount the
contents of a ZIP archive file as a virtual file system. Tcl's ZIP
archive support is limited to basic features and options.
Supported storage methods include only STORE and DEFLATE with optional
139
140
141
142
143
144
145





146
147
148
149
150
151
152
\fBNB:\fR because the current working directory is a concept maintained by the
operating system, using \fBcd\fR into a mounted archive will only work in the
current process, and then not entirely consistently (e.g., if a shared library
uses direct access to the OS rather than through Tcl's filesystem API, it will
not see the current directory as being inside the mount and will not be able
to access the files inside the mount).
.RE





.\" METHOD: root
.TP
\fBzipfs root\fR
.
Returns a constant string which indicates the mount point for zipfs volumes
for the current platform. User should not rely on the mount point being
the same constant string for all platforms.







>
>
>
>
>







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
\fBNB:\fR because the current working directory is a concept maintained by the
operating system, using \fBcd\fR into a mounted archive will only work in the
current process, and then not entirely consistently (e.g., if a shared library
uses direct access to the OS rather than through Tcl's filesystem API, it will
not see the current directory as being inside the mount and will not be able
to access the files inside the mount).
.RE
.TP
.\" METHOD: mountdata
\fBzipfs mountdata\fR \fIdata\fR \fImountpoint\fR
Mounts the ZIP archive content \fIdata\fR as a Tcl virtual filesystem at
\fImountpoint\fR.
.\" METHOD: root
.TP
\fBzipfs root\fR
.
Returns a constant string which indicates the mount point for zipfs volumes
for the current platform. User should not rely on the mount point being
the same constant string for all platforms.
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
.TP
\fBzipfs mkkey\fI password\fR
.
Given the clear text \fIpassword\fR argument, an obfuscated string version is
returned with the same format used in the \fBzipfs mkimg\fR command.
.\" METHOD: lmkimg
.TP
\fBzipfs lmkimg\fI outfile inlist\fR ?\fIpassword infile\fR?
.
This command is like \fBzipfs mkimg\fR, but instead of an input directory,
\fIinlist\fR must be a Tcl list where the odd elements are the names of files
to be copied into the archive in the image, and the even elements are their
respective names within that archive.
.\" METHOD: lmkzip
.TP







|







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
.TP
\fBzipfs mkkey\fI password\fR
.
Given the clear text \fIpassword\fR argument, an obfuscated string version is
returned with the same format used in the \fBzipfs mkimg\fR command.
.\" METHOD: lmkimg
.TP
\fBzipfs lmkimg\fI outfile inlist\fR ?\fIpassword\fR? ?\fIinfile\fR?
.
This command is like \fBzipfs mkimg\fR, but instead of an input directory,
\fIinlist\fR must be a Tcl list where the odd elements are the names of files
to be copied into the archive in the image, and the even elements are their
respective names within that archive.
.\" METHOD: lmkzip
.TP