From bace9be0c624c86a4f36046b40ec898168222f1f Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Wed, 29 May 2019 12:53:15 +0100 Subject: [PATCH] Support for OCaml 4.08. --- src/core_unix.ml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core_unix.ml b/src/core_unix.ml index 2f09044d..2c9bb671 100644 --- a/src/core_unix.ml +++ b/src/core_unix.ml @@ -1240,6 +1240,14 @@ let unlink = unary_filename Unix.unlink let rename = src_dst Unix.rename +[%%if ocaml_version >= (4, 08, 0)] +let unix_link ~src ~dst = + Unix.link ~src ~dst ?follow:None +[%%else] +let unix_link ~src ~dst = + Unix.link ~src ~dst +[%%endif] + let link ?(force = false) ~target ~link_name () = improve (fun () -> @@ -1247,7 +1255,7 @@ let link ?(force = false) ~target ~link_name () = try Unix.unlink link_name with Unix_error (Unix.ENOENT, _, _) -> () end; - Unix.link ~src:target ~dst:link_name) + unix_link ~src:target ~dst:link_name) (fun () -> [("target", atom target); ("link_name", atom link_name)]) ;;