commands/fzip/fzip.cif
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Wed, 22 Sep 2010 10:56:39 +0100
changeset 79 f3d01c9dd099
parent 75 3c3961c1ae26
permissions -rw-r--r--
merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     1
# fzip.cif
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     2
# 
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     3
# Copyright (c) 2010 Accenture. All rights reserved.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     5
# under the terms of the "Eclipse Public License v1.0"
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     8
# 
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     9
# Initial Contributors:
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    10
# Accenture - Initial contribution
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    11
#
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    12
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    13
==name fzip
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    14
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    15
==short-description
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    16
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    17
Compress and decompress files.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    18
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    19
==long-description
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    20
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    21
Generates compressed archives of files or extracts files from a compressed archive. Both 'zip' and 'gzip' file formats are support ('zip' is used by default).
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    22
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    23
==argument filename zipfile optional
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    24
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    25
The zip archive to create or extract. If the zipfile argument is not specified when creating a zip, the first C<file> argument's name is used with a .zip or .gz extension appended.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    26
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    27
==option bool v verbose
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    28
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    29
Enables additional reporting of information regarding the zip/unzip process.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    30
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    31
==option bool u unzip
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    32
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    33
Extract files from the specified zipfile.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    34
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    35
==option filename d directory
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    36
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    37
The directory to extract files into. Must be used in conjunction with C<--unzip>. If not specified, the current working directory is used.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    38
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    39
==option bool r recurse
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    40
61
e07366cad0b2 Updating fzip docs
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    41
Include sub-directories and any files contained therein when archiving.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    42
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    43
==option filename f file multiple
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    44
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    45
A file or directory to add to the zipfile. Only applicable when creating a new archive. If a directory is specified then it and any files contained immediately within that directory are archived. Use --recurse to archive all sub-directories and files within the directory. 
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    46
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    47
==option enum t compression-type
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    48
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    49
==enum-value zip
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    50
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    51
PK Zip format (the default if not specified).
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    52
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    53
==enum-value gzip
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    54
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    55
GNU Zip format. Note, this format can only handle a single file.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    56
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    57
==option bool o overwrite
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    58
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    59
By default fzip will exit with an error if a file it is creating already exists on disk. Use this flag to silently overwrite instead.
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    60
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    61
==copyright
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    62
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    63
Copyright (c) 2008-2010 Accenture. All rights reserved.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    64
75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    65
==smoke-test
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    66
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    67
export TESTDATA "This is some test data for fzip"
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    68
echo -n "$TESTDATA" > test.txt
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    69
rm test.txt.zip $Silent &| echo -n ""
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    70
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    71
# Test zip
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    72
fzip --file test.txt
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    73
exists test.txt.zip || $Error
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    74
rm test.txt
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    75
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    76
# Test unzip
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    77
fzip --unzip test.txt.zip
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    78
exists test.txt || $Error
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    79
cat -b test.txt | export -s RESULT
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    80
var RESULT == "$TESTDATA" || $Error
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    81
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    82
# Test that we don't overwrite files unless --overwrite is specified
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    83
fzip --file test.txt $Silent &| var ? == "-11" || $Error
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    84
fzip --file test.txt --overwrite
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    85
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    86
fzip --unzip test.txt.zip $Silent &| var ? == "-11" || $Error
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    87
fzip --unzip test.txt.zip --overwrite
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    88
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    89
rm test.txt
3c3961c1ae26 Fixed threadpool hang and added lots of smoketests.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 61
diff changeset
    90
rm test.txt.zip