1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

paiza.ioでelixirAdvent Calendar 2022

Day 24

paiza.ioでelixir その124

Last updated at Posted at 2022-12-06

概要

paiza.ioでelixirやってみた。
zipやってみた。

サンプルコード


{:ok, file} = File.open("test.zip", [:write, :compressed])
IO.write(file, "test")
File.close(file)

{:ok, file} = File.open("test.zip", [:read])
IO.read(file, :line)
|> IO.inspect
File.close(file)

{:ok, file} = File.open("test.zip", [:read, :compressed])
IO.read(file, :line)
|> IO.inspect
File.close(file)



実行結果

<<31, 194, 139, 8, 0, 0, 0, 0, 0, 0, 3, 43, 73, 45, 46, 1, 0, 12, 126, 127, 195,
  152, 4, 0, 0, 0>>
"test"

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?