#required Path.sbsl #required Path.sbsl @Global method CreateFromDirectory(StartPath: String, ZipPath: String) val Folder = new File(StartPath) val Archive = new File(ZipPath) var Writer = new ZipWriter(Archive.OpenWritableStream()) Folder.Children.ForEach(Child -> AddToZipArchive(Child, Writer)) Writer.Write() ; @Global method ExtractToDirectory(ZipPath: String, ExtractPath: String) val Archive = new ZipFile(ZipPath) if not Path.Exists(ExtractPath) Files.CreateDirectory(ExtractPath) ; Archive.ExtractAll(ExtractPath) ; method AddToZipArchive(FileToZipping: File, Writer: ZipWriter, RelativePath: String = "") if FileToZipping.IsFile() Writer.Add(FileToZipping.OpenReadableStream(), Path.Join(RelativePath, FileToZipping.Name)) else FileToZipping.Children.ForEach(Child -> AddToZipArchive(Child, Writer, Path.Join(RelativePath, FileToZipping.Name))) ; ;