# Reliable File Access in Elixir Release

When dealing with file access in Elixir releases, using File.read!(file_path) directly might cause issues, as it may not locate files bundled in the release. To ensure your file is correctly located within the release, especially in priv directories, use :code.priv_dir/1 with Path.join/2:
```elixir
file_path = Path.join(:code.priv_dir(:phx_tools), "file.sh")
File.read!(file_path)
```
This approach ensures that the file path works reliably in both development and production, avoiding missing file errors in releases.

---

Created by: mbashia
Date: November 14, 2024
URL: https://elixirdrops.net/d/Aq8iVNtp
