diff options
author | JJ | 2024-01-02 21:49:25 +0000 |
---|---|---|
committer | JJ | 2024-01-02 21:50:47 +0000 |
commit | fde7a1311543badd1052a757d1e2c68272be1188 (patch) | |
tree | abe438ea65ac8d90a1848593846531b59d0e1ce3 /std/prelude/io.pk | |
parent | 4852f1caabcbcd5ad3dd5696bfe4bc428d653f94 (diff) |
std: more fleshing out. merge std.magic back into std.prelude.
Diffstat (limited to 'std/prelude/io.pk')
-rw-r--r-- | std/prelude/io.pk | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/std/prelude/io.pk b/std/prelude/io.pk index e621e01..7a3f059 100644 --- a/std/prelude/io.pk +++ b/std/prelude/io.pk @@ -1,5 +1,7 @@ -## std.io: Platform-independent I/O constructs. +## std.io: Platform-independent I/O constructs. Mostly revolve around files. ## This module is imported by default. +# reference: https://nim-lang.org/docs/syncio.html +# reference: https://doc.rust-lang.org/stable/std/io/ pub type File = ... pub type FileMode = union[Read, Write, ReadWrite, Append] @@ -13,7 +15,7 @@ pub const stderr: File = ... pub func open(path: str, mode: FileMode): File = ... -pub func close(file: File) = +pub func close(file: owned File) = ... pub func write(file: File, values: varargs[str]) = @@ -27,3 +29,18 @@ pub func lines(file: File): Iter[str] = pub func chars(file: File): Iter[chr] = ... + +pub func exists(file: File): bool = + ... + +pub func hidden(file: File): bool = + ... + +pub func size(file: File): uint = + ... + +pub func dir(file: File): str = + ... + +pub func path(file: File): str = + ... |