-module(ewe@internal@file). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/ewe/internal/file.gleam"). -export([open/1]). -export_type([io_device/0, open_error/0]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC(false). -type io_device() :: any(). -type open_error() :: enoent | eacces | eisdir | enotdir | enospc. -file("src/ewe/internal/file.gleam", 13). ?DOC(false). -spec open(binary()) -> {ok, io_device()} | {error, open_error()}. open(Path) -> file:open( Path, [erlang:binary_to_atom(<<"raw"/utf8>>), erlang:binary_to_atom(<<"binary"/utf8>>)] ).