// keeps file open until you cleanUp() the map static SS zipFileSnippetToLazyTextMap(S snippetID) ctex { final ZipFile zip = new ZipFile(loadLibrary(snippetID)); O f = func(S name) { loadTextFileFromZipFile(zip, name) }; ret autoCleanUp(new LazyValueTreeMap(listFilesInZip(zip), f) { public void finalize() ctex { cleanMeUp(); } void cleanMeUp() { pcall-silent { zip.close(); } } }); }