elixir-temp icon indicating copy to clipboard operation
elixir-temp copied to clipboard

The Temp.open function doesn't handle binary data

Open NatTuck opened this issue 3 years ago • 0 comments

    data = <<255, 0, 255>>
    path = Temp.open!("demo", &IO.write(&1, data))

results in

** (ErlangError) Erlang error: :no_translation
    (stdlib 3.15) :io.put_chars(#PID<0.241.0>, :unicode, <<255, 0, 255>>)
    (elixir 1.12.0) lib/file.ex:1421: File.open/3
    (temp 0.4.7) lib/temp.ex:108: Temp.open/2
    (temp 0.4.7) lib/temp.ex:127: Temp.open!/2

NatTuck avatar May 09 '22 18:05 NatTuck