Skip to content

Commit

Permalink
Add ?to_dir param from Unix.symlink to Lwt_unix.symlink wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA committed Oct 6, 2021
1 parent e12504e commit 43c39c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

* Lwt_stream.return, Lwt_stream.return_lwt: singleton stream constructors (#864, Boning Dong).

* Add ?to_dir param from Unix.symlink to Lwt_unix.symlink wrapper (#884, Antonin Décimo)

====== Misc ======

* Code quality improvement: remove an uneeded Obj.magic (#844, Benoit Montagu).
Expand Down
6 changes: 6 additions & 0 deletions src/unix/lwt_unix.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1478,9 +1478,15 @@ let mkfifo name perms =

external symlink_job : string -> string -> unit job = "lwt_unix_symlink_job"

#if OCAML_VERSION >= (4, 03, 0)
let symlink ?to_dir name1 name2 =
if Sys.win32 then
Lwt.return (Unix.symlink ?to_dir name1 name2)
#else
let symlink name1 name2 =
if Sys.win32 then
Lwt.return (Unix.symlink name1 name2)
#endif
else
run_job (symlink_job name1 name2)

Expand Down
2 changes: 1 addition & 1 deletion src/unix/lwt_unix.cppo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ val mkfifo : string -> file_perm -> unit Lwt.t

(** {2 Symbolic links} *)

val symlink : string -> string -> unit Lwt.t
val symlink : ?to_dir:bool -> string -> string -> unit Lwt.t
(** Wrapper for [Unix.symlink] *)

val readlink : string -> string Lwt.t
Expand Down

0 comments on commit 43c39c8

Please sign in to comment.