We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00c5bfc commit 0013a6dCopy full SHA for 0013a6d
examples/files.pics
@@ -0,0 +1,15 @@
1
+
2
+IO :: import std.io
3
+Fs :: import std.fs
4
+Error :: import std.errors
5
6
+getContents :: ({fileName: path}) =
7
+ let
8
+ file := Fs::readToString(path)
9
+ result := file catch return Error::error("Failed to read file: {err}")
10
+ in Error::success(result)
11
12
+result := getContents({fileName: "main.pics"}) catch err
13
+IO::println(result)
14
15
0 commit comments