summaryrefslogtreecommitdiff
path: root/t/data/mkzip.pl
blob: b44584666c316df69e917dba8cb3a7c46eb281ad (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl

#This script will create test zip files used by some of the tests.
#
#    File                Length  Streamed    Method
#    ===============================================
#    emptydef.zip        Yes     No          Deflate
#    emptydefstr.zip     Yes     Yes         Deflate
#    emptystore.zip      Yes     No          Store
#    emptystorestr.zip   Yes     Yes         Store
#


use warnings;
use strict;

use IO::Compress::Zip qw(:all);

my $time = 325532800;

zip \"" => "emptydef.zip", 
        Name => "fred", Stream => 0, Method => ZIP_CM_DEFLATE, Time => $time
    or die "Cannot create zip: $ZipError";

zip \"" => "emptydefstr.zip", 
        Name => "fred", Stream => 1, Method => ZIP_CM_DEFLATE, Time => $time
    or die "Cannot create zip: $ZipError";

zip \"" => "emptystore.zip", 
        Name => "fred", Stream => 0, Method => ZIP_CM_STORE, Time => $time
    or die "Cannot create zip: $ZipError";

zip \"" => "emptystorestr.zip", 
        Name => "fred", Stream => 1, Method => ZIP_CM_STORE, Time => $time
    or die "Cannot create zip: $ZipError";



zip \"abc" => "def.zip", 
        Name => "fred", Stream => 0, Method => ZIP_CM_DEFLATE, Time => $time
    or die "Cannot create zip: $ZipError";

zip \"abc" => "defstr.zip", 
        Name => "fred", Stream => 1, Method => ZIP_CM_DEFLATE, Time => $time
    or die "Cannot create zip: $ZipError";

zip \"abc" => "store.zip", 
        Name => "fred", Stream => 0, Method => ZIP_CM_STORE, Time => $time
    or die "Cannot create zip: $ZipError";

zip \"abc" => "storestr.zip", 
        Name => "fred", Stream => 1, Method => ZIP_CM_STORE, Time => $time
    or die "Cannot create zip: $ZipError";