%% %CopyrightBegin%
%%
%% SPDX-License-Identifier: Apache-2.0
%%
%% Copyright Ericsson AB 2021-2025. All Rights Reserved.
%%
%% %CopyrightEnd%

[;1m  write_file(Filename, Bytes)[0m

  Writes the contents of the [;;4miodata[0m term [;;4mBytes[0m to file [;;4mFilename[0m.
  The file is created if it does not exist. If it exists, the
  previous contents are overwritten. Returns [;;4mok[0m if successful,
  otherwise [;;4m{error, Reason}[0m.

  Typical error reasons:

   • [;;4menoent[0m - A component of the filename does not exist.

   • [;;4menotdir[0m - A component of the filename is not a directory.
     On some platforms, [;;4menoent[0m is returned instead.

   • [;;4menospc[0m - No space is left on the device.

   • [;;4meacces[0m - Missing permission for writing the file or
     searching one of the parent directories.

   • [;;4meisdir[0m - The named file is a directory.

[;1m  write_file(Filename, Bytes, Modes)[0m

  Same as [;;4mwrite_file/2[0m, but takes a third argument [;;4mModes[0m, a list
  of possible modes, see [;;4mopen/2[0m. The mode flags [;;4mbinary[0m and [;;4m[0m
  [;;4mwrite[0m are implicit, so they are not to be used.
