Implement most of the spec reusing scribe & nefthera code
This commit is contained in:
parent
e8b489dd6f
commit
612a98cfde
16 changed files with 225 additions and 25 deletions
14
ocaml/lib/system/file.ml
Normal file
14
ocaml/lib/system/file.ml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
let read_channel channel =
|
||||
let buffer = Buffer.create 4096 in
|
||||
let rec read () =
|
||||
let line = input_line channel in
|
||||
Buffer.add_string buffer line;
|
||||
Buffer.add_char buffer '\n';
|
||||
read ()
|
||||
in
|
||||
try read () with
|
||||
End_of_file -> Buffer.contents buffer
|
||||
|
||||
let read path =
|
||||
let channel = open_in path in
|
||||
read_channel channel
|
||||
Loading…
Add table
Add a link
Reference in a new issue