gpt4 book ai didi

gzip - 如何从 Elixir 代码写入 gzip 文件

转载 作者:行者123 更新时间:2023-12-02 10:55:35 24 4
gpt4 key购买 nike

我想从 Elixir 代码编写 gzip 文件。

我尝试遵循代码,但效果不佳。

io_device = File.open!("/path/to/file.gzip", [:write, :compressed])
IO.write(io_device, "test")

IO.write 返回 :ok,但是 /path/to/file.gzip 为空。

如何写入 gzip 文件?

最佳答案

您也可以一步完成整个事情:

File.write "/path/to/file.gzip", "test", [:compressed]

关于gzip - 如何从 Elixir 代码写入 gzip 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33662684/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com