Posted to tcl by jdc at Tue Jun 26 14:10:05 GMT 2012view raw
- # Create z file with the script in paste http://paste.tclers.tk/2655
- # zip this file with command:
- #
- # zip test.zip test2.bin
- #
- # Now use that test.zip with this script:
- puts [package require vfs]
- puts [package require vfs::zip]
- # This uses streaming and is not OK, it reports 1441792 where 1619008 is expected:
- set ::zip::useStreaming 1
- set f [vfs::zip::Mount test.zip R]
- puts [file copy -force R/test2.bin ~/tmp/test2-bad.bin]
- # Streaming is disabled, and the correct result is retrned (1619008):
- set ::zip::useStreaming 0
- set f [vfs::zip::Mount test.zip R]
- puts [file copy -force R/test2.bin ~/tmp/test2-good.bin]