aboutsummaryrefslogtreecommitdiff
path: root/atrsize.rst
blob: 2c81f90c00c337d9ae1da6820547c6548344a2cb (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
.. RST source for atrsize(1) man page. Convert with:
..   rst2man.py atrsize.rst > atrsize.1
.. rst2man.py comes from the SBo development/docutils package.

=======
atrsize
=======

-----------------------------------------------------------------------------
Change the size of an Atari 8-bit ATR disk image, or create a blank ATR image
-----------------------------------------------------------------------------

.. include:: manhdr.rst

SYNOPSIS
========

atrsize [**-bB**] *infile.atr* [*sectors*]

DESCRIPTION
===========

Without the **-b** or **-B** options:

  *infile.atr* will be backed up to *infile.atr~*, and a new *infile.atr* will
  be  created.  If *sectors* is given, the new image file will be truncated
  or extended to the new size. Without *sectors*, the new image's size will
  be set as follows:

  .. csv-table::
    :header: "Density","Original Sectors","New Sectors"

    "Either","0 - 2","Error"
    "Either","3 - 719","720"
    "Either","720","720 (no change)"
    "Single","721 - 1039","1040 (aka 1050 enhanced density)"
    "Single","1040","1040 (no change)"
    "Single","1041 or more","Unknown (must specify size)"
    "Double","721 - 1339","1440 (aka double sided, double density)"
    "Double","1440","1440 (no change)"
    "Double","1441 or more","Unknown (must specify size)"

  When  *sectors*  is  given,  its allowed range is from 3 to 65535. *infile.atr*
  will be rewritten at the new size.

  When **atrsize** changes the size of an image, the new ATR header
  will  reflect the new size. If the new image is larger than the old
  image, **atrsize** pads the image with empty sectors containing all 0
  data bytes.  If the  new  image is smaller than the old image, it is
  truncated, and any data in the old image that resides in the removed
  sectors will be lost.

  For ATR images where the ATR header doesn't agree with the actual  size
  of  the  file,  the actual file size is used to determine the number of
  sectors. The output image will have its ATR header adjusted to  reflect
  the actual file size of the image, if sectors is not given.

With **-b** or **-B**:

  **atrsize** will create a new, blank image called *infile.atr*. If
  this file already  exists,  however,  it  will not be overwritten
  (instead, **atrsize** will exit with a "file exists" message).

  If *sectors* is given, the new image's size will be set to that many
  sectors. If not given, the new image's size will be 720 sectors.

  **-b** creates a new image with 128-byte sectors (single density)

  **-B** creates a new image with 256-byte sectors (double density).

  New images created with **atrsize** consist of a valid ATR header,
  and sectors filled with zeroes. No boot sectors, directory, VTOC,
  or  filesystem  are  created.  To  use  a  blank  image for file
  storage, it must be formatted with an Atari DOS (either in an
  emulator or with a real Atari  via  SIO2PC  cable). If you're
  trying to create a blank DOS 2.0S disk, use **axe -b**.

NOTES
=====

- **atrsize** cannot change the sector size (density) of an image under
  any circumstances. Only the sector count may be changed.

- **atrsize** will fail if the input file doesn't have a valid ATR header.
  If it's an XFD (raw) image, use **xfd2atr**\(1) to convert it to an ATR first.

EXIT STATUS
===========

Exit status is zero for success, non-zero for failure.

.. include:: manftr.rst