From 4f7ea8de647f80ab9fa1ed05ef0b2d90eb5bb972 Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Sat, 27 Dec 2014 17:53:04 +0100 Subject: [PATCH] Added CCIO.remove_safe. --- src/io/CCIO.ml | 2 ++ src/io/CCIO.mli | 1 + 2 files changed, 3 insertions(+) diff --git a/src/io/CCIO.ml b/src/io/CCIO.ml index 61f64cbb..1a6e5a1a 100644 --- a/src/io/CCIO.ml +++ b/src/io/CCIO.ml @@ -209,6 +209,8 @@ module File = struct let remove f = Sys.remove f + let remove_safe f = try Sys.remove f with _ -> () + let read_dir_base d = if Sys.is_directory d then diff --git a/src/io/CCIO.mli b/src/io/CCIO.mli index 78180bac..b0a92432 100644 --- a/src/io/CCIO.mli +++ b/src/io/CCIO.mli @@ -147,6 +147,7 @@ module File : sig val is_directory : t -> bool val remove : t -> unit + val remove_safe : t -> unit val read_dir : ?recurse:bool -> t -> t gen (** [read_dir d] returns a sequence of files and directory contained