
  -spec copy(Source, Destination, ByteCount) ->
                {ok, BytesCopied} | {error, Reason}
                when
                    Source :: io_device() | Filename | {Filename, Modes},
                    Destination ::
                        io_device() | Filename | {Filename, Modes},
                    Filename :: name_all(),
                    Modes :: [mode()],
                    ByteCount :: non_neg_integer() | infinity,
                    BytesCopied :: non_neg_integer(),
                    Reason :: posix() | badarg | terminated.

  Copies ByteCount bytes from Source to Destination. Source
  and Destination refer to either filenames or IO devices from,
  for example, open/2. ByteCount defaults to infinity,
  denoting an infinite number of bytes.

  Argument Modes is a list of possible modes, see open/2, and
  defaults to [].

  If both Source and Destination refer to filenames, the files
  are opened with [read, binary] and [write, binary] prepended
  to their mode lists, respectively, to optimize the copy.

  If Source refers to a filename, it is opened with read mode
  prepended to the mode list before the copy, and closed when done.

  If Destination refers to a filename, it is opened with write
  mode prepended to the mode list before the copy, and closed when
  done.

  Returns {ok, BytesCopied}, where BytesCopied is the number of
  bytes that was copied, which can be less than ByteCount if end
  of file was encountered on the source. If the operation fails, 
  {error, Reason} is returned.

  Typical error reasons: as for open/2 if a file had to be opened,
  and as for read/2 and write/2.
