title: How to write to a file in RAM in elixir?
body: <p>So if I open a file in RAM memory (see below code 2) with Elixir, how do I write to that file in RAM and then retrieve its contents once the writing is done? The pattern match returns "#Port&lt;0.11114>", which is not the same as a file handle PID apparently as <em>IO.write #Port&lt;0.11114>, "hello"</em> returns an error such as:</p>
  
  <p><strong>Code 1</strong></p>
  
  <pre><code>** (CaseClauseError) no case clause matching: {#Port&lt;0.11114&gt;}
      (elixir) lib/io.ex:495: IO.write/2
  </code></pre>
  
  <p><strong>Code 2</strong></p>
  
  <pre><code>File.open("text.txt", [:ram])
   # =&gt; {:ok, {:file_descriptor, :ram_file, #Port&lt;0.11114&gt;}}
  </code></pre>