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 Sep 16, 2021
1 parent f23f313 commit c15e4e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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
4 changes: 2 additions & 2 deletions src/unix/lwt_unix.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1478,9 +1478,9 @@ let mkfifo name perms =

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

let symlink name1 name2 =
let symlink ?to_dir name1 name2 =
if Sys.win32 then
Lwt.return (Unix.symlink name1 name2)
Lwt.return (Unix.symlink ?to_dir name1 name2)
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 c15e4e3

Please sign in to comment.