summaryrefslogtreecommitdiff
path: root/ocaml/lib/shared/file.ml
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2026-06-27 00:11:43 +0200
committerDJ O'Leary <dijitol@proton.me>2026-06-27 00:11:43 +0200
commit976048a85403fbb0751c34fa42703a3c47f6e918 (patch)
tree46e321d8120c45e318ead66f60165b0b854c85a1 /ocaml/lib/shared/file.ml
parent6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae (diff)
refactor!: change repo directory structure for ocaml
Diffstat (limited to 'ocaml/lib/shared/file.ml')
-rw-r--r--ocaml/lib/shared/file.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/ocaml/lib/shared/file.ml b/ocaml/lib/shared/file.ml
new file mode 100644
index 0000000..74b5abc
--- /dev/null
+++ b/ocaml/lib/shared/file.ml
@@ -0,0 +1,6 @@
+(** [read filename] is the contents of [filename] as a string.
+ The empty string is returned if [filename] does not exist. *)
+let read filename =
+ let chan = In_channel.open_text filename in
+ let content = In_channel.input_all chan in
+ In_channel.close chan ; content