Is there a TempFile equivalent in Elixir like Ruby?

Hi, I’m new to Elixir and I’m wondering:

  1. Is there a TempFile equivalent in Elixir?
  2. Is there a way to write to a file in memory in Elixir? (e.g., you don’t want to write to the disk on heroku since it may get trashed on dyno reset, but you want to store a csv file in memory, and then send it as an email attachment; and after that you don’t care if the csv gets deleted)
1 Like

Welcome!

  1. https://hex.pm/packages/briefly
  2. File.open(“path”, [:ram]). See http://elixir-lang.org/docs/master/elixir/File.html#open/2
4 Likes