Writing and reading
proc main(): void {
hive.file.makeDir("./out")
hive.file.write("./out/report.txt", "done")
hive.file.append("./out/report.txt", "\nand done again")
if hive.file.read("./out/report.txt") is Result.Ok(text) {
echo text
}
}
Asking about a file
proc main(): void {
hive.file.makeDir("./out")
hive.file.write("./out/report.txt", "done")
echo hive.file.exists("./out/report.txt")
if hive.file.size("./out/report.txt") is Result.Ok(n) {
echo n
}
if hive.file.list("./out") is Result.Ok(names) {
echo names
}
}