Ticket UUID: | 7db9574a06b1994c5b3f8cdf13e6ffcbea072d4b | |||
Title: | Undocumented features of zipfs implementation | |||
Type: | Bug | Version: | 9.0 | |
Submitter: | tberg | Created on: | 2024-07-30 08:35:22 | |
Subsystem: | - New Builtin Commands | Assigned To: | nobody | |
Priority: | 5 Medium | Severity: | Important | |
Status: | Closed | Last Modified: | 2024-09-10 12:14:08 | |
Resolution: | Fixed | Closed By: | tberg | |
Closed on: | 2024-09-10 12:14:08 | |||
Description: |
Here are some undocumented features of zipfs (implementing TIP 430): 1. zipfs mount_dataThere is a command 2. ::tcl::zipfs::tcl_library_initThe C source code defines a On the other hand, TIP 430 defines a public subcommand 3. zip archives attached to tclsh/wish or to librariesTIP 430 describes what happens when a zip archive is attached/appended to tclsh/wish or to a library file. In this context, it also mentions the specific mount points This is documented in the tclsh(1) manual page. However, the documentation does not mention the specific mount points. The example at the end of TIP 430 should then also be included in the manual as it clarifies nicely how to exactly use that feature as it is difficult to put in words alone. This could be done in zipfs(n) to not overload the tclsh(1) manual page. Also, the TIP defines something like 4. General consistency with TIP 430In general, the manual page is not consistent with the proposal in the TIP, meaning that zipfs was implemented differently from what the TIP says. Maybe that is OK, I am not sure whether the TIP should always be in line with the implementation, but here are some of the differences:
When we refer to the TIP as "further reading" from the manual page, this could at least increase confusion. | |||
User Comments: |
tberg added on 2024-09-10 12:14:08:
As the TIP is now also edited and contains an additional "Amendment" section, this ticket is consequently closed. tberg added on 2024-08-06 06:22:52: The changes are now implemented with commit d97273f74c2dfecc (apart from the TIP amendment) tberg added on 2024-08-05 23:10:02: After discussion with TCT members, the following was agreed:
cjmcdonald added on 2024-08-03 20:41:15: Regarding zipfs mount_data, note that a corresponding C level interface TclZipfs_MountBuffer has been made public and documented in the man pages at https://www.tcl.tk/man/tcl9.0/TclLib/zipfs.html. So we have the strange situation where the C interface has been documented, but not the Tcl command, and yet there are a set of Tcl tests. I'd like to see the Tcl zipfs mount_data (or mountdata) command documented, rather than made undocumented and internal. I think that there is a useful use case, where a zip archive is transferred to a program from a server via a socket. Without mount_data it would be necessary to write that received archive to a temporary file on disk in order to mount it, whereas with mount_data it could be opened directly from memory. tberg added on 2024-08-02 21:58:00:
As for the TIP, I guess the process should be to first look at the zipfs source code now in core and make sure the documentation (manual pages zipfs(n) and interp(n)) is in line with the implementation. Then, the TIP should be brought in line with those as well ... apnadkarni added on 2024-07-31 03:11:28: 1. Not sure why it is undocumented. It does not appear to be used anywhere within the Tcl core. The test suite does cover it with the same test cases as for `mount`. If we do decide to include it, the name `mount_data` is a little incongruous as I don't think any other ensemble subcommands use snake case (e.g. getwithdefault, not get_with_default) but that may be bike shedding. 2. `tcl_library_init` is internal use, it locates the Tcl support scripts. Should not be documented. In fact the whole tcl::zipfs:: namespace should be treated as private. As far as the TIP `zipfs tcl_library` reference goes, it should be removed from the TIP as it does not appear anywhere in the source and is not needed. 3. Have to look at this closer but as far as `tclsh install` goes, it is not implemented and needs to be removed from the TIP. 4. In a nutshell, the TIP needs to be updated or rewritten to match the implementation and manpage. |
