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

  Closes the file referenced by IoDevice. It mostly returns ok,
  except for some severe errors such as out of memory.

  Notice that if option delayed_write was used when opening the
  file, close/1 can return an old write error and not even try to
  close the file. See open/2.
