Browse Source

fix Unix.EACCES error (#99)

remotes/origin/add-simple-redirecting-site
Corentin Leruth 6 years ago committed by Gal Schlezinger
parent
commit
67ef7b5201
  1. 11
      library/Fs.re

11
library/Fs.re

@ -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();
}; };

Loading…
Cancel
Save