.. 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
