
  -spec write_file(Filename, Bytes) -> ok | {error, Reason}
                      when
                          Filename :: name_all(),
                          Bytes :: iodata(),
                          Reason ::
                              posix() | badarg | terminated | system_limit.

  Writes the contents of the iodata term Bytes to file Filename.
  The file is created if it does not exist. If it exists, the
  previous contents are overwritten. Returns ok if successful,
  otherwise {error, Reason}.

  Typical error reasons:

  enoent:
    A component of the filename does not exist.

  enotdir:
    A component of the filename is not a directory. On some
    platforms, enoent is returned instead.

  enospc:
    No space is left on the device.

  eacces:
    Missing permission for writing the file or searching one of
    the parent directories.

  eisdir:
    The named file is a directory.
