Skip to content

Instantly share code, notes, and snippets.

@zindel
Created October 29, 2018 17:07
Show Gist options
  • Select an option

  • Save zindel/c1da7774d1858dbfacc3184edf71c87a to your computer and use it in GitHub Desktop.

Select an option

Save zindel/c1da7774d1858dbfacc3184edf71c87a to your computer and use it in GitHub Desktop.
let%lwt (emitted_modules, size) =
Lwt_io.with_file(
~mode=Lwt_io.Output,
~perm=0o777,
~flags=Unix.[O_CREAT, O_TRUNC, O_WRONLY, O_SHARE_DELETE, O_SYNC, O_NONBLOCK],
temp_file,
run(start_time, ctx),
);
Logs.debug(x => x("Before RENAME --- %s", temp_file));
Logs.debug(x => x("Before RENAME output: %s", ctx.output_file));
let%lwt () = Lwt_unix.rename(temp_file, ctx.output_file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment