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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
.. RST source for unalf(1) man page. Convert with:
.. rst2man.py unalf.rst > unalf.1
.. include:: ver.rst
.. |date| date::
=====
unalf
=====
--------------------------------
extract Atari 8-bit ALF archives
--------------------------------
:Manual section: 1
:Manual group: Urchlay's Atari 8-bit Tools
:Date: |date|
:Version: |version|
SYNOPSIS
========
unalf [**--help**] [**-aehtklLopqtv**] [**-d** *dir*] [**-x** *wildcard*] *alf-file* [*wildcard* ...]
DESCRIPTION
===========
**unalf** lists or extracts the contents of an *ALF* archive.
*ALF* is a compressed archive format similar to **arc**\(1), though
not compatible with it. It was used on the Atari 8-bit platform
beginning in the late 1980s.
Extracted files are written to the current directory by
default. Existing files are backed up by default (by adding a **~**
suffix to the filename).
If one or more **wildcard** arguments are provided, files will only be
listed or extracted if they match one of the wildcards. See **WILDCARDS**
below for details.
OPTIONS
=======
-a
Convert text file line endings and tabs from ATASCII to ASCII. Text
files are detected by looking at the first 2 bytes of the extracted
file. If both are printable ASCII (including ATASCII EOL, aka **$9B**), the
file is considered text.
Note that *only* line-endings and tabs are converted. Other ATASCII
characters are left alone. If you need anything more in-depth, use
**a8cat**\(1).
.. convert EOLs and tabs in text files.
**-aa**
Convert line endings in all extracted files. This will corrupt any
executables or non-text data files, so use with caution.
.. convert EOLs and tabs in ALL files.
-d output-dir
Write extracted files to this directory, which will be created if it
does not exist. The default is the current directory.
.. set output directory (created if needed).
-e
Extract files. This is actually a no-op, as extraction is the
default action.
.. extract files (redundant; this is the default action).
-h, --help
Show built-in help message.
.. show this help message.
-k
Keep trailing periods. In most (all?) ALF files, filenames that have no
extension are stored with a trailing period, e.g. '**FOO**' would
be stored as '**FOO.**'. On the Atari, the extracted file would be
named '**FOO**', so **unalf** does the same by default. With **-k**,
the file will be named '**FOO.**'.
.. keep trailing periods (dots) in filenames.
-l
List filenames in archive, one per line, but do not extract. Use
**-v** for more information (file size, etc). Obeys *wildcards* and
the **-x**, **-L**, **-k** options.
.. list files in archive (filenames only).
-L
Lowercase filesnames. Example: **FOO.TXT** will extract to **foo.txt**.
.. use lowercase filenames.
-o
Overwrite files, if they already exist. The default is to rename
existing files, adding a **~** suffix. Note that renaming **file**
to **file~** *will* overwrite **file~** if it already exists.
.. overwrite files (do not create file~ backups).
-p
Extract to standard output. All the files that get extracted will be
printed to stdout with no delimiters, so this is most useful when
only extracting one file. **-q** is automatically enabled by this option.
*Warning:* No checking is done to see whether stdout is a terminal.
Printing binary files to a terminal is a good way to make a mess.
Even text files with the EOLs translated can still contain ATASCII
formatting/graphics codes that can confuse your terminal. You have
been warned.
.. extract to stdout (enables -q).
-q
Quiet extraction or testing: do not print "Uncrunching *file*"
or "Testing *file*" messages. Errors and warnings will still be
printed. This is the default when **-p** is used. This option
doesn't do anything when used with **-l** or **-v**.
.. quiet: don't print filenames during extraction/testing.
-t
Test archive. Same as extraction, except the files are not written
anywhere.
.. test archive.
-v
Verbose listing of archive contents, with compressed and original
sizes, compression ration, date/time stamps, and checksum. The
output format is similar to that of **arc -v**, minus the *Stowage*
column, since *ALF* doesn't support multiple compression types. The
date and time are displayed, but in most .alf files these are the
default values of "8 Jan 82 12:24a".
Unlike **-l**, the **-v** listing shows the filenames exactly as
stored in the archive (ignores **-L**, enables **-k**), and always
shows all the files (ignores *wildcards* and **-x**).
.. verbose listing of archive contents.
-V, --version
Show **unalf** version number and exit.
.. show version number.
-x wildcard
Exclude (do not list or extract) files matching *wildcard*. See
**WILDCARDS** below. This option can be given multiple times
to exclude multiple patterns.
.. exclude <wildcard>. may be given multiple times.
WILDCARDS
=========
Wildcard (aka glob) matching works like it does on the Atari: *\*.\**
matches any filename (whether or not it has an extension), and *\**
or *\*.* only match filenames with no extension.
A *\** matches any number of characters (including zero). A *?*
matches a single character.
Like the Atari, anything in the name or extension following a *\** is
ignored: **FOO\*BAR.TXT** is equivalent to **FOO\*.TXT**, and
**FOO.T\*T** is equivalent to **FOO.T\***. **FOO\*TXT** is
equivalent to **FOO\***, and *will not* match the file **FOO.TXT**.
Unlike the Atari, matching is case-insensitive.
To avoid your shell trying to expand the wildcards, always quote them!
Example::
unalf filename.alf '*.txt'
EXIT STATUS
===========
0
Success.
1
Fatal error (I/O or bad command-line arguments, stack under/overrun).
2
Processing completed OK, but at least one file in the archive
has a bad checksum.
DIAGNOSTICS
===========
Besides the standard error messages such as "no such file or directory":
**this is an ARC file, not ALF**
Self-explanatory. Use the **arc**\(1) utility for this file.
**not an ALF file**
Self-explanatory. Either the file is too small (less than 29 bytes)
or its first two bytes don't match the *ALF* signature **0x1a** **0x0f**\.
**junk at EOF (ignored)**
Usually this is caused by the .alf file being stored on a CP/M disk
at some time, or by a dumb file transfer protocol. Either way, the
file gets padded to the block size of the filesystem or protocol.
Usually, the padding characters are **0x1a**, aka ASCII control-Z.
If you see this message, you can ignore it. It's intended to let
you know that this .alf file can't be appended to by the **ALF.COM**
aka **LZ.COM** Atari utility.
**checksum error on** *<file>*
The archive is corrupt. If *<file>* is a text file, it may be
partially readable. If it's an executable or other binary file, it's
probably unrecoverable.
**stack underrun/overrun**
Generally means the archive is corrupt. Valid ALF files should never
cause these errors.
If you have an ALF file that does this, try it with the Atari
**UNALF14.COM** and see if it has the same problem. If it doesn't,
you've found a bug in **unalf**, please send me the .alf file via
email (see **AUTHOR**, below). Actually, I'd be interested to see
the .alf file even if it doesn't work on the Atari either.
**bad Atari filename** *<filename>* *<reason>*
The filename stored in the ALF header doesn't follow the rules for
Atari DOS filenames. *<reason>* will be something like "doesn't start
with A-Z" or "invalid character". The filename will be printed with
any unprintable characters as hex values (e.g. **$01**).
**header #<n> (compressed|original) size is...**
Followed by "impossibly large", "suspiciously large", or "too large
to fit on a floppy disk". May indicate a corrupt archive, or someone
really might have created an ALF file with files this big... though
"impossibly large" means >=16MB. **unalf** can't extract a file
that big.
**filename has underscore, OK on Sparta/MyDOS, not Atari DOS 2.x**
Not an actual problem, unless you try to extract this ALF file on
an Atari running Atari DOS 2.0/2.5, or any other DOS that doesn't
allow underscores in filenames.
NOTES
=====
This **unalf** is 100% compatible with the original Atari **UNALF14.COM**
aka **DZ.COM**, with the following differences:
- There is no interactive mode. The file to extract must be given as
a command-line argument, and the output directory must be given
with the **-d** option.
- This **unalf** is capable of listing or testing the contents of an archive
without extracting it, plus other handy features such as extracting
to standard output and text file EOL conversion.
- Turning the screen off for speed makes no sense on modern operating
systems, so there's no option for that.
Neither this **unalf** nor **UNALF14.COM** actually use the dates/times
stored in the archive. Extracted files will have their timestamps set
to the current date/time.
COPYRIGHT
=========
**unalf** is released under the WTPFL: Do WTF you want with this.
AUTHOR
======
B. Watson <urchlay@slackware.uk>
SEE ALSO
========
**unalf**\(1)
.. include:: manftr.rst
|