
  -spec sync(IoDevice) -> ok | {error, Reason}
                when
                    IoDevice :: io_device(),
                    Reason :: posix() | badarg | terminated.

  Ensures that any buffers kept by the operating system (not by the
  Erlang runtime system) are written to disk. On some platforms,
  this function might have no effect.

  A typical error reason is:

  enospc:
    Not enough space left to write the file.
