Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
preciz committed Jul 13, 2024
1 parent 36168e4 commit 32c3e80
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ MyApp.Tmp.dir(fn tmp_dir_path ->
# then return a value
{:ok, :work_done}
end)
# => {:ok, :work_done}
```

### Options
Expand All @@ -58,9 +59,7 @@ When calling `MyApp.Tmp.dir/2`, you can pass the following options:
- `:base_dir` (optional) - Base directory for the temporary directory, defaults to `System.tmp_dir()` or the value set in `use Tmp`
- `:timeout` (optional) - Timeout in milliseconds, defaults to `:infinity`

### Examples

Basic usage:
### More Examples

```elixir
MyApp.Tmp.dir(fn tmp_dir_path ->
Expand All @@ -72,16 +71,6 @@ end, prefix: "my_app", base_dir: "/tmp/custom_base")
# => 4
```

Using a custom base directory:

```elixir
MyApp.CustomTmp.dir(fn tmp_dir_path ->
# tmp_dir_path will be within "/path/to/custom/base/dir"
File.touch(Path.join(tmp_dir_path, "file_in_custom_dir"))
# ... other work
end)
```

## Docs

Documentation can be found at [https://hexdocs.pm/tmp](https://hexdocs.pm/tmp).
Expand Down

0 comments on commit 32c3e80

Please sign in to comment.