File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 4
4
Running Distributions
5
5
=====================
6
6
7
+ Extracting Distributions
8
+ ========================
9
+
10
+ Distributions are defined as zstandard-compressed tarballs.
11
+
12
+ Modern versions of ``tar `` support zstandard and you can extract
13
+ like any normal archive::
14
+
15
+ $ tar -axvf path/to/distribution.tar.zstd
16
+
17
+ (The ``-a `` argument tells tar to guess the compression format by
18
+ the file extension.)
19
+
20
+ If you do not have ``tar ``, you can install and use the ``zstd ``
21
+ tool (typically available via a ``zstd `` or ``zstandard `` system
22
+ package)::
23
+
24
+ $ zstd -d path/to/distribution.tar.zstd
25
+ $ tar -xvf path/to/distribution.tar
26
+
27
+ If you want to extract the distribution with Python, use the
28
+ ``zstandard `` Python package:
29
+
30
+ .. code-block :: python
31
+
32
+ import tar
33
+ import zstandard
34
+
35
+ with open (" path/to/distribution.tar.zstd" , " rb" ) as ifh:
36
+ dctx = zstandard.ZstdDecompressor()
37
+ with dctx.stream_reader(ifh) as reader:
38
+ with tarfile.open(mode = " r|" , fileobj = reader) as tf:
39
+ tf.extractall(" path/to/output/directory" )
40
+
7
41
Runtime Requirements
8
42
====================
9
43
You can’t perform that action at this time.
0 commit comments