debian: Prepare for upload
[xz/debian.git] / dos / README.txt
blob0e8f6c086e3bfd8d1d17c33003438b27537785be
2 XZ Utils on DOS
3 ===============
5 DOS-specific filename handling
7     xz detects at runtime if long filename (LFN) support is
8     available and will use it by default. It can be disabled by
9     setting an environment variable:
11         set lfn=n
13     When xz is in LFN mode, it behaves pretty much the same as it
14     does on other operating systems. Examples:
16         xz foo.tar          -> foo.tar.xz
17         xz -d foo.tar.xz    -> foo.tar
19         xz -F lzma foo.tar  -> foo.tar.lzma
20         xz -d foo.tar.lzma  -> foo.tar
22     When LFN support isn't available or it is disabled with LFN=n
23     environment setting, xz works in short filename (SFN) mode. This
24     affects filename suffix handling when compressing.
26     When compressing to the .xz format in SFN mode:
28       - Files without an extension get .xz just like on LFN systems.
30       - *.tar files become *.txz (shorthand for *.tar.xz). *.txz
31         is recognized by xz on all supported operating systems.
32         (Try to avoid confusing this with gzipped .txt files.)
34       - Files with 1-3 character extension have their extension modified
35         so that the last character is a dash ("-"). If the extension
36         is already three characters, the last character is lost. The
37         resulting *.?- or *.??- filename is recognized in LFN mode, but
38         it isn't recognized by xz on other operating systems.
40     Examples:
42         xz foo              -> foo.xz     |   xz -d foo.xz    -> foo
43         xz foo.tar          -> foo.txz    |   xz -d foo.txz   -> foo.tar
44         xz foo.c            -> foo.c-     |   xz -d foo.c-    -> foo.c
45         xz read.me          -> read.me-   |   xz -d read.me-  -> read.me
46         xz foo.txt          -> foo.tx-    |   xz -d foo.tx-   -> foo.tx   !
48     Note that in the last example above, the third character of the
49     filename extension is lost.
51     When compressing to the legacy .lzma format in SFN mode:
53       - *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz
54         is recognized by xz on all supported operating systems.
56       - Other files become *.lzm. The original filename extension
57         is lost. *.lzm is recognized also in LFN mode, but it is not
58         recognized by xz on other operating systems.
60     Examples:
62         xz -F lzma foo      -> foo.lzm    |   xz -d foo.lzm   -> foo
63         xz -F lzma foo.tar  -> foo.tlz    |   xz -d foo.tlz   -> foo.tar
64         xz -F lzma foo.c    -> foo.lzm    |   xz -d foo.lzm   -> foo      !
65         xz -F lzma read.me  -> read.lzm   |   xz -d read.lzm  -> read     !
66         xz -F lzma foo.txt  -> foo.lzm    |   xz -d foo.lzm   -> foo      !
68     When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to
69     any file format:
71       - If the suffix begins with a dot, the filename extension is
72         replaced with the new suffix. The original extension is lost.
74       - If the suffix doesn't begin with a dot and the filename has no
75         extension and the filename given on the command line doesn't
76         have a dot at the end, the custom suffix is appended just like
77         on LFN systems.
79       - If the suffix doesn't begin with a dot and the filename has
80         an extension (or an extension-less filename is given with a dot
81         at the end), the last 1-3 characters of the filename extension
82         may get overwritten to fit the given custom suffix.
84     Examples:
86         xz -S x foo        -> foox      |  xz -dS x foox      -> foo
87         xz -S x foo.       -> foo.x     |  xz -dS x foo.x     -> foo
88         xz -S .x foo       -> foo.x     |  xz -dS .x foo.x    -> foo
89         xz -S .x foo.      -> foo.x     |  xz -dS .x foo.x    -> foo
90         xz -S x.y foo      -> foox.y    |  xz -dS x.y foox.y  -> foo
91         xz -S .a foo.c     -> foo.a     |  xz -dS .a foo.a    -> foo      !
92         xz -S a  foo.c     -> foo.ca    |  xz -dS a foo.ca    -> foo.c
93         xz -S ab foo.c     -> foo.cab   |  xz -dS ab foo.cab  -> foo.c
94         xz -S ab read.me   -> read.mab  |  xz -dS ab read.mab -> read.m   !
95         xz -S ab foo.txt   -> foo.tab   |  xz -dS ab foo.tab  -> foo.t    !
96         xz -S abc foo.txt  -> foo.abc   |  xz -dS abc foo.abc -> foo      !
98     When decompressing, the suffix handling in SFN mode is the same as
99     in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are
100     recognized also in LFN mode.
102     xz handles certain uncommon situations safely:
104       - If the generated output filename refers to the same file as
105         the input file, xz detects this and refuses to compress or
106         decompress the input file even if --force is used. This can
107         happen when giving an overlong filename in SFN mode. E.g.
108         "xz -S x foo.texinfo" would try to write to foo.tex which on
109         SFN system is the same file as foo.texinfo.
111       - If the generated output filename is a special file like "con"
112         or "prn", xz detects this and refuses to compress or decompress
113         the input file even if --force is used.
116 Bugs
118     xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
120     Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
121     when running under Windows XP Command Prompt (something goes wrong
122     with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.