summaryrefslogtreecommitdiff
path: root/xdelta3/www/xdelta3-cmdline.html
blob: e5203a4851c52bd17642fac469894e225ff2e6a3 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Xdelta3 command-line guide (BETA)</title>
  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  <link rel="stylesheet" type="text/css" href="xdelta3.css"/>
</head>
<body>

<!-- $Format: "$WWWLeftNavBar$" $ --!>
<table cellpadding="20px" width=700> <tr> <td class="leftbdr" valign=top height=600 width=100> <div class="leftbody"> <h1>Xdelta</h1> <a href="xdelta3.html">overview</a><br> <a href="xdelta3-cmdline.html">command&nbsp;line</a><br> <a href="xdelta3-api-guide.html">api&nbsp;guide</a><br> <br><a href="http://xdelta.org">xdelta.org</a></h2> </div> </td> <td valign=top width=500>


<!-- Copyright (C) 2003 and onward. Joshua P. MacDonald --!>

<h1>command-line guide</h1>

<code>xdelta3</code> can be run with syntax familiar but not similar to gzip;
it requires you to specify the output file in most cases, rather than applying
any default filename extensions.  These are cases that resemble gzip:<p>

<div class="example">
<pre>
xdelta3 -c file_to_compress > delta_file
xdelta3 -dc delta_file > file_uncompressed
</pre>
</div>
<p>

The <code>-c</code> option says to write to the standard output.  The
<code>-d</code> option says to decode.  The default action is to encode (also
specified by <code>-e</code>).  <code>xdelta3</code> also supports long
command names, these two commands are equivalent to the ones abvove:<p>

<div class="example">
<pre>
xdelta3 encode file_to_compress > delta_file
xdelta3 decode delta_file > file_uncompressed
</pre>
</div>
<p>

<code>xdelta3</code> has the notion of a default filename for decoding.  If
you specified a file name during the encode step, it is used as the default
for decoding.  The <code>-s</code> option specifies a <em>source file</em> for
delta-compression.<p>

<div class="example">
<pre>
xdelta3 -s source_file target_file delta_file
xdelta3 -d delta_file
</pre>
</div>
<p>

The second line above fills in "source_file" and "target_file" as the input
and output filenames.  Without the <code>-f</code> option,
<code>xdelta3</code> will not overwrite an existing file.  When there are no
default filenames (e.g., in decode), standard input and standard output are
used.  In the example below, the default source filename is applied in
decoding.
<p>

<div class="example">
<pre>
cat target_file | xdelta3 -s source_file > delta_file
xdelta3 -d < delta_file > target_file.1
</pre>
</div>
<p>

<code>xdelta3</code> recognizes externally compressed inputs, so the following
command produces the expected results:<p>

<div class="example">
<pre>
xdelta3 -s beta2.tar.gz beta3.tar.gz beta3.tar.gz.xd
xdelta3 -ds beta2.tar.gz beta3.tar.gz.xd beta3.tar.gz.1
</pre>
</div>
<p>

You can avoid the intermediate file and use <code>xdelta3</code> together
with a <code>tar</code>-pipeline.

<div class="example">
<pre>
tar -cf - beta3 | xdelta3 -s beta2.tar > beta3.tar.xd
xdelta3 -d beta3.tar.xd | tar -xf -
</pre>
</div>
<p>

<code>xdelta</code> can print various information about a compressed file with
the "printhdr" command.  The "printhdrs" command prints information about each
<em>window</em> of the encoding.  The "printdelta" command prints the actual
encoding for each window, in human-readable format.<p>

<div class="example">
<pre>
# xdelta3 printdelta delta_file
VCDIFF version:               0
VCDIFF header size:           5
VCDIFF header indicator:      none
VCDIFF secondary compressor:  none
VCDIFF window number:         0
VCDIFF window indicator:      VCD_SOURCE VCD_ADLER32 
VCDIFF adler32 checksum:      48BFADB6
VCDIFF copy window length:    2813
VCDIFF copy window offset:    0
VCDIFF delta encoding length: 93
VCDIFF target window length:  2903
VCDIFF data section length:   72
VCDIFF inst section length:   8
VCDIFF addr section length:   3
  Offset Code Type1 Size1 @Addr1 + Type2 Size2 @Addr2
  000000 019  CPY_0 1535 @0     
  001535 001  ADD     72        
  001607 019  CPY_0 1296 @1517  
</pre>
</div>
<br>
<p>


<h1>xdelta3 -h</h1>

<pre>
usage: xdelta3 [command/options] [input [output]]
special command names:
    config      prints xdelta3 configuration
    decode      decompress the input
    encode      compress the input
    test        run the builtin tests
special commands for VCDIFF inputs:
    printdelta  print information about the entire delta
    printhdr    print information about the first window
    printhdrs   print information about all windows
standard options:
   -0 .. -9     compression level
   -c           use stdout
   -d           decompress
   -e           compress
   -f           force overwrite
   -h           show help
   -q           be quiet
   -v           be verbose (max 2)
   -V           show version
memory options:
   -B blksize   source file block size
   -M memsize   memory budget for hash tables
   -W winsize   input window buffer size
compression options:
   -s source    source file to copy from (if any)
   -S [djw|fgk] enable/disable secondary compression
   -N           disable small string-matching compression
   -D           disable external decompression (encode/decode)
   -R           disable external recompression (decode)
</pre>
<p>

</td>
</tr>
</table>

</body>
</html>