|
|
@ -26,12 +26,11 @@ let readdir = dir => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
let writeFile = (path, contents) => { |
|
|
|
let writeFile = (path, contents) => { |
|
|
|
let%lwt x = Lwt_unix.openfile(path, [Unix.O_RDWR, Unix.O_CREAT], 777); |
|
|
|
let%lwt targetFile = Lwt_io.open_file(~mode=Lwt_io.Output, path); |
|
|
|
let%lwt _ = |
|
|
|
|
|
|
|
Lwt.finalize( |
|
|
|
let%lwt () = Lwt_io.write(targetFile, contents); |
|
|
|
() => Lwt_unix.write_string(x, contents, 0, String.length(contents)), |
|
|
|
let%lwt () = Lwt_io.close(targetFile); |
|
|
|
() => Lwt_unix.close(x), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
Lwt.return(); |
|
|
|
Lwt.return(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|