plt/racket — pull request #566 by simmone (2014-02-09 09:17:39+00:00)
Title: add help func with-unzip with-unzip-entry

I use dynamic-wind wrap a helper fund for unzip and unzip-entry.

So it can use with-unzip to unzip file and do something and auto deleted temporary files.

It make unzip and unzip-entry easier to use.

example:

(with-unzip "unzip-me.zip"
(lambda (tmp_dir)
(with-input-from-file (build-path tmp_dir "test-zip" "1" "data.dat")
(lambda ()
(test (read-line) => "chenxiao"))))))

(with-unzip-entry "unzip-me.zip"
(build-path "test-zip" "1" "data.dat")
(lambda (tmp_file)
(with-input-from-file tmp_file
(lambda ()
(test (read-line) => "chenxiao")))))