Summary: This diff introduces [ISys.file_exists] that is similar to [Sys.file_exists_exn], but returns [false] when the result is known, instead of raising an exception. Reviewed By: jvillard Differential Revision: D28059863 fbshipit-source-id: d54851cfbmaster
parent
3f053e389c
commit
0a48a6cba0
@ -0,0 +1,11 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
let file_exists ?follow_symlinks path =
|
||||
match Sys.file_exists ?follow_symlinks path with `Yes -> true | `No | `Unknown -> false
|
@ -0,0 +1,12 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
val file_exists : ?follow_symlinks:bool -> string -> bool
|
||||
(** Similar to [Sys.file_exists_exn], but it returns [false] when the result is unknown, instead of
|
||||
raising an exception. [follow_symlinks] is true by default. *)
|
Loading…
Reference in new issue