ZipFile.frink

View or download ZipFile.frink in plain text format


/** This file demonstrates reading the contents of a zip file. */

zip = newJava["java.util.zip.ZipFile", ["../jar/frink.jar"]]

// Sort entries by size
for zipEntry = sort[zip.entries[], {|a,b| a.getSize[] <=> b.getSize[] } ]
{
   // Print size and filename
   println[zipEntry.getSize[] + "\t" + zipEntry.toString[]]

   // This would uncompress and print out the contents of each file.
   // println[read[zip.getInputStream[zipEntry]]]
}

zip.close[]


View or download ZipFile.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17898 days, 23 hours, 11 minutes ago.