.. RST source for xfd2atr(1) man page. Convert with:
..   rst2man.py xfd2atr.rst > xfd2atr.1
.. rst2man.py comes from the SBo development/docutils package.

=======
xfd2atr
=======

------------------------------------------------------------
Convert an Atari 8-bit XFD (raw) disk image to an ATR image.
------------------------------------------------------------

.. include:: manhdr.rst

SYNOPSIS
========

*xfd2atr* [*-sd*] *infile.xfd* [*outfile.atr*]

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

**xfd2atr**  generates and adds a 16-byte ATR header to an XFD
image. If no **-s** or **-d** options are given, xfd2atr tries to
guess the density based on the file size.

OPTIONS
=======

-s
  Assume the image uses single density (128-byte) sectors, instead
  of trying to guess the density from the file size.

-d
  Assume the image uses double density (256-byte) sectors, instead
  of trying to guess the density from the file size.

NOTES
=====

You  may  use **-** for *infile* to read from standard input and/or
**-** for *outfile* to write to standard output. If a filename is
supplied for *outfile*,  it  will  always  be  used  as-is (no *.atr*
extension will be appended).

If *outfile* is omitted, it is constructed like so:

  - If reading from standard input, write to standard output.

  - If reading from a file whose name ends with an *.xfd*  or  *.XFD*
    extension, replace the extension with *.atr*.

  - Otherwise, append *.atr* to the input filename.

Since XFD images are raw dumps with no header or structure, it's
impossible to know the correct density (bytes/sector) for a given
image  for certain.

However,  no  known Atari-compatible disk format uses other than 128
or 256 bytes per sector (or possibly 512, for some hard disk images,
but **xfd2atr** doesn't support these). This means any file that isn't a
multiple of 128  bytes  in size will be rejected.

Likewise,  no  known format uses an odd number of sectors, and
it's assumed that all double-density images will begin with  3
single-density boot  sectors  (true  of  all  floppy  images you're
ever likely to run across; may not be true of hard disk images).

Given these assumptions, **xfd2atr** is able  to  make  an  educated
guess about  the  correct  sector size and count to use for the ATR
header it generates. If it guesses wrong, the resulting ATR image
will  be  unusable;  if this happens, re-run **xfd2atr** and force the
density with **-s** or **-d**.

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

Exit status is zero for success, non-zero for  failure.  Further,
exit status will be 1 for errors involving file I/O (file not found,
permissions, etc), and 2 for structural errors in the XFD file.

.. include:: manftr.rst
