summaryrefslogtreecommitdiff
path: root/lib/bio/bio.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bio/bio.myr')
-rw-r--r--lib/bio/bio.myr8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index b76f985..032a926 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -38,11 +38,19 @@ pkg bio =
/* pkg funcs */
pkglocal const ensureread : (f : file#, n : std.size -> std.result(std.size, err))
pkglocal const ensurewrite : (f : file#, n : std.size -> std.result(std.size, err))
+
+ impl disposable file#
;;
const Bufsz = 16*std.KiB
const Small = 512
+impl disposable file# =
+ __dispose__ = {f
+ close(f)
+ }
+;;
+
/* Creates a file from an fd, opened in the given mode. */
const mk = {mode, vt
var f