- Introduces
Briefly.create(type: :device)
to return a raw IO device. #43.create(directory: true)
is deprecated in favor ofcreate(type: :directory)
.
This version changes the Briefly API, so read the notes below and upgrade with care.
-
Change the return value of
Briefly.create/1
to be either{:ok, path}
or{:error, Exception.t()}
. The following exceptions may be returned:-
%Briefly.NoRootDirectoryError{}
- Briefly is unable to create a root temporary directory. The exception contains the temp dirs attempted. -
%Briefly.WriteError{}
- A temporary entry cannot be created. The exception contains the POSIX error code the caused the failure.
-
For example, if you have this:
case Briefly.create() do
{:ok, path} -> path
{:no_space, _} -> raise "no space"
{:too_many_attempts, _} -> raise "too many attempts"
{:no_tmp, _} -> raise "no tmp dirs"
end
...then change it to this:
case Briefly.create() do
{:ok, path} -> path
{:error, %Briefly.WriteError{code: :enospc}} -> raise "no space"
{:error, %Briefly.WriteError{code: c}} when c in [:eexist, :eacces] -> raise "too many attempts"
{:error, %Briefly.NoRootDirectoryError{}} -> raise "no tmp dirs"
{:error, exception} when is_exception(exception) -> raise exception
end
- Add
Briefly.give_away/3
to transfer ownership of a tmp file. - Deprecate the
:monitor_pid
option.
If you were previously using :monitor_pid
like this:
{:ok, path} = Briefly.create(monitor_pid: pid)
...then change it to this:
{:ok, path} = Briefly.create()
:ok = Briefly.give_away(path, pid)
- Fix an issue with custom tmp dirs without a trailing slash (#24) @srgpqt
Note Briefly v0.4+ requires Elixir v1.11+.
- Add
:monitor_pid
option toBriefly.create/1
(#19) @scarfacedeb - Avoid folder naming conflicts with monotonic time and random padding (#18) @zph
- Add
Briefly.cleanup/0
(#10) @gmalkas - Fix an issue where the sub directory is not created correctly (#9) @Schultzer
- Fix error reasons to conform to posix error codes (#4) @ngeraedts
- Numerous updates for CI / language changes (h/t @bryanstearns @k-cross @szajbus @devstopfix @sgerrand @mad42 @warmwaffles)
Add support for temporary directories
Update license
Add create options
Update docs
Initial release