aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output_zip.org
blob: a90799730d601b84f69fe0ddfd21576927abef05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#+TITLE: sdp output zip
#+AUTHOR: Ralph Amissah
#+EMAIL: ralph.amissah@gmail.com
#+STARTUP: indent
#+LANGUAGE: en
#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+OPTIONS: author:nil email:nil creator:nil timestamp:nil
#+PROPERTY: header-args :padline no :exports code :noweb yes
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+FILETAGS: :sdp:rel:output:
#+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n)

[[./sdp.org][sdp]]  [[./][org/]]
* _zip_
** template                                                     :template:

#+BEGIN_SRC d :tangle ../src/sdp/create_zip_file.d
template createZipFile() {
  import std.file;
  import std.outbuffer;
  import std.string;
  import std.zip;
  void createZipFile(
    string zip_file_name,
    void[] compressed_zip_data,
  ) {
    try {
      write(zip_file_name, compressed_zip_data);
    } catch (ZipException ex) {
      // Handle Errors
    }
  }
}
#+END_SRC