I would like to write gzip file from elixir code.
I tried to following code, but it doesn't work well.
io_device = File.open!("/path/to/file.gzip", [:write, :compressed])
IO.write(io_device, "test")
IO.write
returns :ok
, but, /path/to/file.gzip
is empty.
How can I write to gzip file?
You can also do whole thing in one step:
File.write "/path/to/file.gzip", "test", [:compressed]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With