-module(ffi@file). -compile(no_auto_import). -export([open_file_exclusive/1, write/2, ensure_dir/1]). -export_type([io_device/0]). -type io_device() :: any(). -spec open_file_exclusive(binary()) -> {ok, io_device()} | {error, gleam@erlang@file:reason()}. open_file_exclusive(A) -> gladvent_ffi:open_file_exclusive(A). -spec write(io_device(), binary()) -> {ok, nil} | {error, gleam@erlang@file:reason()}. write(Iod, S) -> gladvent_ffi:write(Iod, gleam@erlang@charlist:from_string(S)). -spec ensure_dir(binary()) -> {ok, nil} | {error, gleam@erlang@file:reason()}. ensure_dir(Dir) -> gladvent_ffi:ensure_dir(gleam@erlang@charlist:from_string(Dir)).