Posted to tcl by jdc at Tue Jun 26 14:10:05 GMT 2012view raw

  1. # Create z file with the script in paste http://paste.tclers.tk/2655
  2. # zip this file with command:
  3. #
  4. # zip test.zip test2.bin
  5. #
  6. # Now use that test.zip with this script:
  7.  
  8. puts [package require vfs]
  9. puts [package require vfs::zip]
  10.  
  11. # This uses streaming and is not OK, it reports 1441792 where 1619008 is expected:
  12. set ::zip::useStreaming 1
  13. set f [vfs::zip::Mount test.zip R]
  14. puts [file copy -force R/test2.bin ~/tmp/test2-bad.bin]
  15.  
  16. # Streaming is disabled, and the correct result is retrned (1619008):
  17. set ::zip::useStreaming 0
  18. set f [vfs::zip::Mount test.zip R]
  19. puts [file copy -force R/test2.bin ~/tmp/test2-good.bin]