Pular para o conteúdo

Arcane.IO

Arquivos, diretórios, JSON e CSV.

exemplo
adopt Arcane.IO as IO

IO.write("_temp.txt", "linha 1\nlinha 2")
out IO.read("_temp.txt").lines().length()
out IO.size("_temp.txt"), IO.ext("_temp.txt")
IO.delete("_temp.txt")

Guia com contexto e boas práticas: IO.

Funções (27)#

Assinatura
abs(path)
append(path, content)
basename(path)
copy(src, dst)
cwd()
delete(path)
dirname(path)
exists(path)
ext(path)
file_exists(path)
join(*parts)
list_dir(path='.')
listdir(path='.')
mkdir(path)
open(path, mode='r')
path(path)
read(path)
read_csv(path)
read_file(path)
read_json(path)
rename(old, new)
shell(command)
size(path)
write(path, content)
write_csv(path, data)
write_file(path, content)
write_json(path, data, indent=2)