zlib 与 ActiveTcl 8.5 接口?
我正在尝试使用 ActiveTcl 8.5 中的 zlib 扩展,以便将压缩的 blob 保存到文件中。 win32 上的 ActiveTcl 8.5.5 和 8.5.6 都有 zlibtcl 1.2.3 扩展。 我已经尝试过:
package require zlibtcl
和
load zlibtcl123.dll
这两者似乎都表明扩展已正确加载。 但是,我似乎无法弄清楚访问扩展程序需要什么命令。 我知道 ActiveTcl 8.6b1 及以上版本具有内置的 zlib 功能(http://wiki.tcl.tk/4610 ),但是我需要部署到必须使用 8.5.x 的现有系统。
据我所知,加载扩展不会向解释器添加任何新命令,这非常令人困惑。 在 dll 上运行字符串似乎不会透露任何其他信息。
注意:我的备份计划是 SWIG zlib,但如果可能的话,我更愿意使用现有的扩展。
I'm trying to use the zlib extension in ActiveTcl 8.5 in order to save out a compressed blob to a file. Both ActiveTcl 8.5.5 and 8.5.6 on win32 have a zlibtcl 1.2.3 extension. I've tried both:
package require zlibtcl
and
load zlibtcl123.dll
Which both seem to indicate that the extension is properly loaded. However, I can't seem to figure out what command is necessary to access the extension. I am aware that ActiveTcl 8.6b1 onwards has the zlib functionality built in (http://wiki.tcl.tk/4610), however I need to deploy to existing systems that must use 8.5.x.
As far as I can tell, loading the extension does not add any new commands to the interpreter, which is quite confusing. Running a strings on the dll does not seem to reveal any additional information.
Note: my backup plan is to SWIG zlib, but I'd prefer to use the existing extension if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 vfs::zip 包可能会更幸运。 comp.lang.tcl 上有一个示例 此处。
You might have more luck with the vfs::zip package. There is an example on comp.lang.tcl here.
zlibtcl 仅由 Img 包使用来处理 PNG 等图像格式的压缩。 按照上面的建议,尝试 vfs::zip。 Trf 包也值得研究。 请参阅http://wiki.tcl.tk/479
zlibtcl is used only by the Img package to handle the compression in image formats like PNG. As suggested above, try vfs::zip. The Trf package is also worthwhile looking into. See http://wiki.tcl.tk/479
您可以从 equi4 获取 zlib 软件包的副本,他们提供它作为对
tclkit
Tcl 解释器/打包系统支持的一部分。 它不支持 8.6 中使用的完整接口,但它确实有足够的接口可以压缩和解压缩。或者您可以只使用
tclkit
而不是tclsh
/wish
并已内置 zlib 包。You can get a copy of the zlib package from equi4, who provide it as part of their support for the
tclkit
Tcl interpreter/packaging system. It doesn't support the full interface used in 8.6, but it does have enough that you can compression and decompression.Or you can just use
tclkit
instead oftclsh
/wish
and have the zlib package already built in.